User Tools

Site Tools


qemunet:misc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qemunet:misc [2019/05/27 13:49] orelqemunet:misc [2024/03/18 15:06] (current) – external edit 127.0.0.1
Line 3: Line 3:
 ==== Convert QEMU image for VirtualBox ==== ==== Convert QEMU image for VirtualBox ====
  
 +Conversion avec l'outil de VirtualBox (format VDI) :
  
-  qemu-img convert debian10.img -O raw debian10.raw +  vboxmanage convertfromraw debian10x.img --format vdi debian10x.vdi 
-  VBoxManage convertfromraw debian10.raw --format vdi debian10.vdi+  vboxmanage convertdd debian10x.qcow2 --format vdi debian10x.vdi
  
 +Conversion avec l'outil de QEMU :
  
 +  qemu-img convert debian10x.img -O raw debian10x.raw
 +  qemu-img convert -O qcow debian10x.img debian10x.qcow   # QCOW Image V1
 +  qemu-img convert -O qcow2 -o compat=0.10 debian10x.img debian10x.qcow2 # QCOW Image V2
 +  qemu-img convert -O qcow2 debian10x.img debian10x.qcow3 # QCOW Image V3 (default) !!!
 +
 +QCOW v1 & v2 sont supportés... QCOW Image v3 supporté à partir de VirtualBox 6.0.8 (?).
 ==== Nested Virtualization in QEMU/KVM ==== ==== Nested Virtualization in QEMU/KVM ====
  
Line 46: Line 54:
   $ qemu-system-x86_64 -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing   $ qemu-system-x86_64 -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing
  
 +Se connecter avec un viewer à la VM avec: 
  
-More in details, with copy & paste support:  +  $ sudo apt-get install virt-viewer 
 +  $ remote-viewer spice://127.0.0.1:5900 
 + 
 + 
 +In order to add copy & paste support:  
      
-  $ qemu-system-x86_64 -enable-kvm -hda kali.img  -name syl -m 2G -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0+  $ SPICEOPT="-vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing
 +  $ SPICEMORE="-device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0
 +  $ qemu-system-x86_64 -enable-kvm -hda kali.img  -name syl -m 2G $SPICEOPT $SPICEMORE
  
 +Installez spice-vdagent sur le guest (linux) et vérifiez que les services space-vdagentd et spice-vdagent sont bien démarrés...
  
-Installer spice-vdagent sur le guest (linux).  
  
   $ sudo apt-get install spice-vdagent   $ sudo apt-get install spice-vdagent
 +  $ sudo systemctl enable spice-vdagentd
 +  $ sudo systemctl enable spice-vdagent
 +  $ sudo systemctl daemon-reload
 +  $ sudo rm -f /var/run/spice-vdagentd/*
 +  $ sudo reboot
  
 Pour windows, il faut installer : https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe Pour windows, il faut installer : https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe
  
-Demarrer space-vdagentd au boot et spicevdagent apres le login X.+Bon, l'installation sous "windaube" est assez capricieuse... Une fois spice guest tools installé en display normal, faire plusieurs reboot avec les options suivantes incrémentalement, jusqu'à ce que ça tombe en marche !
  
-Se connecter a la VM avec:  +  $ SPICEOPT1="-vga qxl" 
- +  $ SPICEOPT2="$SPICEOPT1 -spice port=5900,addr=127.0.0.1,disable-ticketing" 
-  $ remote-viewer spice://127.0.0.1:5900+  $ SPICEOPT3="$SPICEOPT2 -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0"
  
 +(Eventuellement, faire un reboot avec vdaagent sans spice... Après un plantage, j'ai réinstallé spice guest tools et c'est retombé en marche après deux reboot?)
  
 __More:__ https://www.linux-kvm.org/page/SPICE __More:__ https://www.linux-kvm.org/page/SPICE
 +
 +
 +==== Socket display ====
 +
 +        # elif [ "$QEMUDISPLAY" = "socket" ] ; then # unix socket mode
 +        #     # bug: with this option, any ctrl-c (SIGINT) in VM will kill all qemu session!
 +        #     # solution: use socat in raw mode with escape option!
 +        #     CMD="$CMD -monitor unix:$SESSIONDIR/$HOSTNAME.monitor,server,nowait"
 +        #     # redirect both qemu monitor & console in two Unix sockets, that can be connected with socat
 +        #     # $ socat stdin,raw,echo=0 unix-connect:session/<hostname>.sock
 +        #     CMD="$CMD -serial unix:$SESSIONDIR/$HOSTNAME.sock,server" # wait client connection, else use "nowait" option
 +        #     # CMD="$CMD -nographic"
 +        #     CMD="$CMD -display none"
 +        #     echo "[$HOSTNAME] $CMD"
 +        #     bash -c "${CMD[@]}" &
 +
 +    # if [ "$QEMUDISPLAY" = "socket" ] ; then
 +    #     echo "=> To access the QEMU console of each VM, please use the command:"
 +    #     echo "     $ ./connect.sh <session_dir> <vm_hostname>"
 +    # fi
 +
qemunet/misc.1558964946.txt.gz · Last modified: 2024/03/18 15:05 (external edit)