Daily Shaarli

All links of one day in a single page.

November 13, 2017

Semantic Versioning 2.0.0 | Semantic Versioning
Spice User Manual

Un peu de documentation très bien faite sur SPICE et QEMU, et en y retouchant, j’ai maintenant le support de la souris avec relâchement automatique ! \o/
C’est de la folie !

Voilà ce que j’utilise pour un système installé sur une partition dédiée (en l’occurrence, un système Microsoft Windows 7 pour développer dessus quand je n’ai pas le choix) ; première partie à exécuter en tant que root pour monter le système, et deuxième partie en tant que simple utilisateur (moi en l’occurrence) :
-------- BEGIN FILE virtu_win7.sh --------

!/bin/env bash

coding: UTF-8

2017-11-13

DISKIMG="/dev/md/thican_win7"

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then

Those 3 commands, as root, before starting, to create the device /dev/md/thican_win7

FILE_MBR="/media/data_raid_2t_xfs/virtual_machines/win7_boot.mbr"
# Boot on "/dev/sdc1"
PARTITION_BOOT_UUID="586887AD68878888"
PARTITION_BOOT="/dev/disk/by-uuid/${PARTITION_BOOT_UUID}"
# System on "/dev/sdc2"
PARTITION_SYSTEM_UUID="D0C40178C40161D8"
PARTITION_SYSTEM="/dev/disk/by-uuid/${PARTITION_SYSTEM_UUID}"
losetup --find "${FILE_MBR}" && \
mdadm --build "${DISKIMG}" --level=linear --raid-devices=3 "$(losetup --list --output NAME --noheadings --associated "${FILE_MBR}")" "${PARTITION_BOOT}" "${PARTITION_SYSTEM}" && \
chown thican "${DISKIMG}"*
# En extra :
chmod g=rX,o=rX /dev/md/

else

export QEMU_AUDIO_DRV=pa
MAC_ADDR="…"

/usr/bin/qemu-system-x86_64 -enable-kvm -machine type=pc,accel=kvm \
-cpu host -smp cores=2,threads=1 -m size=8G \
-drive file="${DISKIMG}",media=disk,format=raw,cache=none,if=virtio \
-boot order=c,menu=off -monitor stdio \
-name "Windows 7" \
-net nic,vlan=0,macaddr="${MAC_ADDR:-52:54:00:01:23:45}",model=virtio \
-net user,vlan=0 \
-display none -vga qxl -spice port=6000,disable-ticketing,disable-copy-paste,playback-compression=off \
-device virtio-serial-pci \
-chardev spicevmc,id=vdagent,debug=0,name=vdagent \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
-usb \
-soundhw hda

-display gtk -vga vmware \

fi
-------- END FILE virtu_win7.sh --------

Et ensuite, j’utilise un client graphique tel que Remmina pour afficher avec SPICE la VM.

Profitez-en bien.