I want to run a virtual machine with 3 requirements:
- Being able to copy/paste between host and VM
- Run two monitors (two separated windows)
- Only CLI (no GUI manager like virt-manager)
For that, I used the following options:
-device virtio-serial-pci
-spice port=5930,disable-ticketing=on
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0
-chardev spicevmc,id=spicechannel0,name=vdagent
-vga none -device qxl-vga,vgamem_mb=32
--enable-kvm -cpu host -m 6G
And I connect to it with spicy -h 127.0.0.1 -p 5930
The copy/paste works well but I have only one monitors. On the guest, by running xrandr
I can see :
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
Virtual-0 connected primary 1024x768+0+0 0mm x 0mm
1024x768 59.95*+
1920x1200 59.95
1920x1080 60.00
1600x1200 59.95
1680x1050 60.00
1400x1050 60.00
1280x1024 59.95
1440x900 59.99
1280x960 59.99
1280x854 59.95
1280x800 59.96
1280x720 59.97
1152x768 59.95
800x600 59.96
848x480 59.94
720x480 59.94
640x480 59.94
Virtual-1 disconnected
Virtual-2 disconnected
Virtual-3 disconnected
Maybe I can connect to Virtual-1? How can I add a second monitor?
EDIT: I am using awesomeWM on archlinux
EDIT: In the guest, I tried to associate the display "Virtual-2" with a vnc server to have my second display:
$ xrandr --addmode Virtual-2 1920x1080
$ xrandr --output Virtual-2 --mode 1920x1080 --right-of Virtual-1
$ xrandr | grep Virtual-2
Virtual-2 disconnected 1920x1080+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
$ x11vnc -multiptr -display :0 -clip 1920x1080+1920+0
But when I try to connect to it I got a black screen. Note that if I do the same thing but for Virtual-1 display, it works well.