-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirtual_desktop.txt
71 lines (55 loc) · 3.96 KB
/
virtual_desktop.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
==================================virtual desktop==================================
1.change password and expiration for vnc/spice.
-----------------------------------------
# ...-vnc :$port,password ---> $ vncviewer $IP:$port
two ways to set the password separately in the monitor,
1).(qemu)set_password vnc $passwd -- set vnc password
(qemu)expire_password vnc $time -- set vnc password expire-time
2).(qemu)__com.redhat_set_password vnc $passwd $expiration -- set vnc password
# ...-spice port=$port,password=$password ---> $ spicec $IP:port -w $password
1).(qemu)set_password spice $password -- set spice password
(qemu)expire_password spice $time -- set spice password expire-time
2).(qemu)__com.redhat_set_password spice $password $expiration -- set spice password
2.start a guest and force specific ip protocol to be used by ipv4 / ipv6.
--------------------------------------------------------------------------
eg:
...-spice disable-ticketing,port=5991,ipv4 -vga qxl
...-spice disable-ticketing,port=5991,ipv6 -vga qxl
# spicec -h 2002:7::11 -p 5991
# spicec -h localhost -p 5991
use netstat to check whenever spice client and server are using ipv4 or ipv6.
# netstat -ant
3.configure the ipv6.
---------------------
# ip addr add 2002:5::11/64 dev eth0 (breth0/switch)
# service ip6tables stop
configure another 2002:5::12/64 in another host, and try to ping each other with "ping6" command.
4.connect to listening vnc with "reverse".
------------------------------------------
1).launch a listening vnc on host A by: $ vncviewer -listen 7000
2).launch qemu-kvm process and try to connect to the listening vnc on host B by: ...-vnc ${ip_of_host_A's}:7000,"reverse"
5.Enable/disable copy/paste between guest and client_host (only for spice).
------------------------------------------------------------
For linux guest: Install the spice-vdagent
run # lsmod | grep virtio-console, make sure the virtio-serial driver loaded.
For windows guest: Install spice-agent, virtio-win-prewhql
in windows cmd, go to directory which saved 'vdservice'
vdservice install
net start vdservice
Enalbe copy/paste:
# ...-monitor stdio -spice port=5931,disable-ticketing -vga qxl -device virtio-serial-pci,id=virtio-serial1 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial1.0,nr=3,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
Disalbe copy/paste:
# ...-monitor stdio -spice port=5931,disable-ticketing,disable-copy-paste -vga qxl -device virtio-serial-pci,id=virtio-serial1 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial1.0,nr=3,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
6.Test x509 + password with spice.
----------------------------------
# hostname
localhost.localdomain
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.66.9.242 localhost.localdomain
# /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Penryn -enable-kvm -m 2048 -smp 2,sockets=1,cores=2,threads=1 -usb -device usb-tablet,id=input0 -name rhel-6.3-64 -uuid `uuidgen` -drive file=/home/RHEL-6.3-Beta-1.0-x86_64.qcow2,format=qcow2,if=none,id=drive-disk,cache=none,werror=stop,rerror=stop -device ide-drive,drive=drive-disk,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,bootindex=2 -device virtio-balloon-pci,id=ballooning -spice tls-port=8000,disable-ticketing,x509-dir=/home/spice_x509-NTx,password=sluo -vga qxl -monitor stdio
# spicec -h localhost.localdomain --secure-port 8000 --ca-file /home/spice_x509-NTx/ca-cert.pem -w sluo
# remote-viewer --spice-ca-file /home/spice_x509-NTx/ca-cert.pem spice://localhost.localdomain/?tls-port=8000
7.boot guest with '-vnc none',the VNC server functionality is initialized, but the server itself is not started, we can start the VNC server later with the QEMU monitor.
(qemu) change vnc localhost:1 / (qemu) change vnc $host_ip:1