mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Allow serving VNC over a unix domain socket
QEMU supports serving VNC over a unix domain socket rather than traditional
TCP host/port. This is specified with:
<graphics type='vnc' socket='/foo/bar/baz'/>
This provides better security access control than VNC listening on
127.0.0.1, but will cause issues with tools that rely on the lax security
(virt-manager in fedora runs as regular user by default, and wouldn't be
able to access a socket owned by 'qemu' or 'root').
Also not currently supported by any clients, though I have patches for
virt-manager, and virt-viewer should be simple to update.
v2:
schema: Make listen vs. socket a <choice>
This commit is contained in:
@@ -178,6 +178,7 @@ mymain(int argc, char **argv)
|
||||
DO_TEST("disk-drive-network-sheepdog");
|
||||
DO_TEST("disk-usb");
|
||||
DO_TEST("graphics-vnc");
|
||||
DO_TEST("graphics-vnc-socket");
|
||||
|
||||
driver.vncSASL = 1;
|
||||
driver.vncSASLdir = strdup("/root/.sasl2");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc unix:/tmp/foo.socket
|
||||
30
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml
Normal file
30
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219200</memory>
|
||||
<currentMemory>219200</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<address type='drive' controller='0' bus='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='ide' index='0'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<graphics type='vnc' socket='/tmp/foo.socket'/>
|
||||
<video>
|
||||
<model type='cirrus' vram='9216' heads='1'/>
|
||||
</video>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
||||
@@ -321,6 +321,7 @@ mymain(int argc, char **argv)
|
||||
DO_TEST("disk-scsi-device-auto", QEMUD_CMD_FLAG_DRIVE |
|
||||
QEMUD_CMD_FLAG_DEVICE | QEMUD_CMD_FLAG_NODEFCONFIG, false);
|
||||
DO_TEST("graphics-vnc", 0, false);
|
||||
DO_TEST("graphics-vnc-socket", 0, false);
|
||||
|
||||
driver.vncSASL = 1;
|
||||
driver.vncSASLdir = strdup("/root/.sasl2");
|
||||
|
||||
Reference in New Issue
Block a user