Hi to clarify, the Ubuntu apparmor.d doesn't include the default directory definition (/etc/pki/libvirt-spice) unlike the /etc/pki/libvirt-vnc directory, (which is included). S you will always need to add this directory as far as I am aware from my experience.<div>
<br></div><div>I've made a suggestion that this is added as an update to the apparmor.d as part of the qemu-kvm-spice package install, whether anybody reads it I don't know.<div><br></div><div>The actual error is:</div>
<div><br></div><div><div>2012-11-13 17:07:18.780+0000: starting up</div><div>LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm -name VM11 -S -M pc-1.2 -cpu Opteron_G3,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme -enable-kvm -m 2048 -smp 1,sockets=1,cores=1,threads=1 -uuid 2e6cca5a-9269-a9d2-2e2b-867ac0ce0a8c -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VM11.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-disk0,if=none,id=drive-virtio-disk0,format=raw,cache=writeback -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=3 -drive file=/var/lib/libvirt/local/dynamic-pool0/buildsvr-disk1,if=none,id=drive-virtio-disk1,format=raw,cache=writethrough -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=4 -drive if=none,id=drive-ide0-0-0,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-media,if=none,id=drive-ide0-0-1,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=1 -netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=22 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:1a:b3:4c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -spice port=5908,tls-port=5918,addr=0.0.0.0,agent-mouse=on,disable-ticketing,x509-dir=/var/lib/libvirt/pki/libvirt-spice,tls-channel=main,plaintext-channel=display,plaintext-channel=inputs,plaintext-channel=cursor,plaintext-channel=playback,plaintext-channel=record,plaintext-channel=usbredir,image-compression=auto_glz,streaming-video=filter -k en-gb -vga qxl -global qxl-vga.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5</div>
<div>char device redirected to /dev/pts/1</div><div>((null):2230): Spice-Warning **: reds.c:2812:reds_handle_read_link_done: spice channels 1 should be encrypted</div></div><div><br></div><div><br><div><br><br><div class="gmail_quote">
On Tue, Nov 13, 2012 at 4:58 PM, David Jaša <span dir="ltr"><<a href="mailto:djasa@redhat.com" target="_blank">djasa@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think it is something different but I can't say it for sure unless I<br>
see the exact message...<br>
<br>
Jodi Curtis píše v Út 13. 11. 2012 v 16:26 +0000:<br>
<div class="im">> My latest issue is the error spice warning spice channels 1 should be<br>
> encrypted, I'm guessing this is an authentication issue with my<br>
> attempts to connect?<br>
><br>
> On Tue, Nov 13, 2012 at 7:37 AM, Jodi Curtis <<a href="mailto:jodi.curtis@gmail.com">jodi.curtis@gmail.com</a>><br>
> wrote:<br>
> The VM seems to start without complaints after adding the key<br>
> directory after /etc/pki/libvirt-vnc** r, in an identical<br>
> format within the apparmor.d config file<br>
<br>
</div>ubuntu docs should be probably updated about need to copy certs/keys to<br>
the default directory OR need to update apparmor configuration if custom<br>
directory is used.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> I haven't really slept much so I will check login after<br>
> sleeping<br>
><br>
><br>
> On Mon, Nov 12, 2012 at 11:33 PM, Jodi Curtis<br>
> <<a href="mailto:jodi.curtis@gmail.com">jodi.curtis@gmail.com</a>> wrote:<br>
> Hi<br>
><br>
><br>
> Copy of attempt so far, hopefully this will be useful<br>
> to have online, I will carry on tomorrow!<br>
><br>
><br>
> /etc/hostname<br>
><br>
><br>
> squealer<br>
><br>
><br>
> /etc/hosts<br>
><br>
><br>
> 127.0.0.1 localhost squealer <a href="http://squealer.maiakaat.co.uk" target="_blank">squealer.maiakaat.co.uk</a><br>
> <a href="http://maiakaat.co.uk" target="_blank">maiakaat.co.uk</a> <a href="http://www.maiakaat.co.uk" target="_blank">www.maiakaat.co.uk</a><br>
> 192.168.2.140 localhost squealer<br>
> <a href="http://squealer.maiakaat.co.uk" target="_blank">squealer.maiakaat.co.uk</a> <a href="http://maiakaat.co.uk" target="_blank">maiakaat.co.uk</a><br>
> <a href="http://www.maiakaat.co.uk" target="_blank">www.maiakaat.co.uk</a><br>
><br>
><br>
> cat /etc/passwd<br>
><br>
><br>
> root:x:0:0:root:/root:/bin/bash<br>
> daemon:x:1:1:daemon:/usr/sbin:/bin/sh<br>
> bin:x:2:2:bin:/bin:/bin/sh<br>
> sys:x:3:3:sys:/dev:/bin/sh<br>
> sync:x:4:65534:sync:/bin:/bin/sync<br>
> games:x:5:60:games:/usr/games:/bin/sh<br>
> man:x:6:12:man:/var/cache/man:/bin/sh<br>
> lp:x:7:7:lp:/var/spool/lpd:/bin/sh<br>
> mail:x:8:8:mail:/var/mail:/bin/sh<br>
> news:x:9:9:news:/var/spool/news:/bin/sh<br>
> uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh<br>
> proxy:x:13:13:proxy:/bin:/bin/sh<br>
> www-data:x:33:33:www-data:/var/www:/bin/sh<br>
> backup:x:34:34:backup:/var/backups:/bin/sh<br>
> list:x:38:38:Mailing List Manager:/var/list:/bin/sh<br>
> irc:x:39:39:ircd:/var/run/ircd:/bin/sh<br>
> gnats:x:41:41:Gnats Bug-Reporting System<br>
> (admin):/var/lib/gnats:/bin/sh<br>
> nobody:x:65534:65534:nobody:/nonexistent:/bin/sh<br>
> libuuid:x:100:101::/var/lib/libuuid:/bin/sh<br>
> syslog:x:101:103::/home/syslog:/bin/false<br>
> messagebus:x:102:105::/var/run/dbus:/bin/false<br>
> whoopsie:x:103:107::/nonexistent:/bin/false<br>
> landscape:x:104:110::/var/lib/landscape:/bin/false<br>
> sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin<br>
> libvirt-qemu:x:106:106:Libvirt<br>
> Qemu,,,:/var/lib/libvirt:/bin/false<br>
> libvirt-dnsmasq:x:107:112:Libvirt<br>
> Dnsmasq,,,:/var/lib/libvirt/dnsmasq:/bin/false<br>
> jodic:x:1000:1000:jodic,,,:/home/jodic:/bin/bash<br>
><br>
><br>
> cd /var/lib/libvirt<br>
> sudo ls -l<br>
><br>
><br>
> drwx--x--x 2 root root 4096 Oct 6 01:58 boot<br>
> drwxr-xr-x 2 root root 4096 Oct 30 21:06<br>
> dnsmasq<br>
> drwxr-xr-x 2 libvirt-qemu root 4096 Oct 31 06:11<br>
> drivers<br>
> drwx--x--x 2 root root 4096 Oct 6 01:58<br>
> images<br>
> drwxr-xr-x 5 libvirt-qemu root 4096 Nov 1 12:56 local<br>
> drwxr-xr-x 2 root root 4096 Nov 12 18:03<br>
> network<br>
> drwxr-x--- 5 libvirt-qemu kvm 4096 Nov 12 18:11 qemu<br>
> drwx------ 2 root root 4096 Oct 6 01:58<br>
> sanlock<br>
> drwxr-xr-x 5 libvirt-qemu root 4096 Oct 31 06:22<br>
> shared<br>
><br>
><br>
> #drivers to be forwarded as filesystem element with<br>
> Windows drivers<br>
> #local contains volume pools(2) for VM volumes, and<br>
> all xml files used to create VM's volumes and pools.<br>
><br>
><br>
> sudo usermod -a -G root,kvm jodic<br>
><br>
><br>
> chmod 775 /var/lib/libvirt/qemu<br>
> #temporary change<br>
><br>
><br>
> #libvirt directory permissions are drwxr-xr-x<br>
><br>
><br>
> sudo mkdir /var/lib/libvirt/pki<br>
> sudo mkdir /var/lib/libvirt/pki/libvirt-spice<br>
><br>
><br>
> sudo nano /etc/libvirt/qemu.conf<br>
><br>
><br>
> spice_tls = 1<br>
> spice_tls_x509_cert_dir =<br>
> "/var/lib/libvirt/pki/libvirt-spice"<br>
><br>
><br>
> cd /var/lib/libvirt/pki/libvirt-spice<br>
><br>
><br>
> sudo openssl genrsa -des3 -out ca-key.pem 1024<br>
> sudo openssl req -new -x509 -days 750 -key ca-key.pem<br>
> -out ca-cert.pem -utf8 -subj "/CN=Self Signed"<br>
> sudo openssl genrsa -out server-key.pem 1024<br>
> sudo openssl req -new -key server-key.pem -out<br>
> server-key.csr -utf8 -subj "/CN=squealer"<br>
> sudo openssl x509 req -days 750 -in server-key.csr -CA<br>
> ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out<br>
> server-cert.pem<br>
> sudo openssl rsa -in server-key.pem -out<br>
> server-key.pem.insecure<br>
> sudo mv server-key.pem server-key.pem.secure<br>
> sudo mv server-key.pem.insecure server-key.pem<br>
><br>
><br>
> sudo chown libvirt-qemu /var/lib/libvirt/pki<br>
> sudo chown<br>
> libvirt-qemu /var/lib/libvirt/pki/libvirt-spice<br>
> sudo chown<br>
> libvirt-qemu /var/lib/libvirt/pki/libvirt-spice/server-key.pem<br>
> sudo chown<br>
> libvirt-qemu /var/lib/libvirt/pki/libvirt-spice/server-cert.pem<br>
> sudo chown<br>
> libvirt-qemu /var/lib/libvirt/pki/libvirt-spice/ca-cert.pem<br>
><br>
><br>
> #temporary change<br>
> sudo chmod 775 /var/lib/libvirt/pki<br>
> sudo chmod 775 /var/lib/libvirt/pki/libvirt-spice<br>
> sudo chmod<br>
> 775 /var/lib/libvirt/pki/libvirt-spice/server-key.pem<br>
> sudo chmod<br>
> 775 /var/lib/libvirt/pki/libvirt-spice/server-cert.pem<br>
> sudo chmod<br>
> 775 /var/lib/libvirt/pki/libvirt-spice/ca-cert.pem<br>
><br>
><br>
> sudo virsh destroy VM11<br>
> sudo virsh undefine VM11<br>
><br>
><br>
> sudo shutdown -r now<br>
> #don't know how to restart service for re-read of<br>
> qemu.conf in Ubuntu<br>
><br>
><br>
> #Ubuntu offering 28 updates - none related to<br>
> virtualization at all<br>
><br>
><br>
> sudo apt-get update<br>
> sudo apt-get upgrade<br>
><br>
><br>
> sudo virsh<br>
> define /var/lib/libvirt/local/xml/default-revision7.xml<br>
><br>
><br>
> #defined VM11<br>
><br>
><br>
> sudo virsh start VM11<br>
><br>
><br>
> #started VM11 23:14 ish UK time<br>
><br>
><br>
> sudo /var/log/libvirt/qemu/qemu.conf<br>
><br>
><br>
> 2012-11-12 23:13:44.233+0000: starting up<br>
> LC_ALL=C<br>
> PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm -name VM11 -S -M pc-1.2 -cpu Opteron_G3,+ibs,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+3dnow,+3dnowext,+pdpe1gb,+fxsr_opt,+mmxext,+ht,+vme -enable-kvm -m 2048 -smp 1,sockets=1,cores=1,threads=1 -uuid 35a6984d-0b77-da48-770e-a8fb0c7c284d -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VM11.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-disk0,if=none,id=drive-virtio-disk0,format=raw,cache=writeback -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=3 -drive file=/var/lib/libvirt/local/dynamic-pool0/buildsvr-disk1,if=none,id=drive-virtio-disk1,format=raw,cache=writethrough -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=4 -drive if=none,id=drive-ide0-0-0,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-media,if=none,id=drive-ide0-0-1,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=1 -netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=22 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:1a:b3:4c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -spice port=5908,tls-port=5918,addr=0.0.0.0,agent-mouse=on,disable-ticketing,x509-dir=/var/lib/libvirt/pki/libvirt-spice,tls-channel=main,plaintext-channel=display,plaintext-channel=inputs,plaintext-channel=cursor,plaintext-channel=playback,plaintext-channel=record,plaintext-channel=usbredir,image-compression=auto_glz,streaming-video=filter -k en-gb -vga qxl -global qxl-vga.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5<br>
> char device redirected to /dev/pts/2<br>
> ((null):8891): Spice-Warning **:<br>
> reds.c:3307:reds_init_ssl: Could not load certificates<br>
> from /var/lib/libvirt/pki/libvirt-spice/server-cert.pem<br>
> ((null):8891): Spice-Warning **:<br>
> reds.c:3317:reds_init_ssl: Could not use private key<br>
> file<br>
> ((null):8891): Spice-Warning **:<br>
> reds.c:3325:reds_init_ssl: Could not use CA<br>
> file /var/lib/libvirt/pki/libvirt-spice/ca-cert.pem<br>
><br>
><br>
> sudo virsh destroy VM11<br>
><br>
><br>
> #destroyed<br>
><br>
><br>
> $ sudo /usr/bin/kvm-spice -monitor stdio -spice<br>
> tls-port=5800,x509-dir=/etc/pki/libvirt-spice,disable-ticketing<br>
><br>
><br>
><br>
><br>
> #output<br>
><br>
><br>
> QEMU 0.12.0 monitor - type 'help' for more information<br>
> (qemu)<br>
><br>
><br>
> "If you see the same error again, there is something<br>
> wrong with<br>
> certificates themselves. If not, verify that they are<br>
> accessible to the<br>
> qemu process - note that it may run under different<br>
> user than root and<br>
> in addition, it may be confined by SELinux or<br>
> AppArmor. I can't speak<br>
> for AppArmor but for SELinux, you may need to restore<br>
> context of the<br>
> files (and directories) to make them accessible for<br>
> qemu."<br>
><br>
><br>
> I'll begin looking at the permissions and security<br>
> tomorrow, although its stretching my<br>
> knowledge of Linux here, I guess the only way to learn<br>
> is to do though.<br>
><br>
><br>
> I will likely set up my vm's without security for now<br>
> (they are local only) to have something I can dev on<br>
> etc<br>
> These are nfs (if the passthrough bug in ubuntu<br>
> kvm-spice doesn't affect the passthrough of a logical<br>
> volume to the guest, repos (source code), build and<br>
> dev desktop<br>
><br>
><br>
> Thanks again for all the help<br>
><br>
><br>
> On Mon, Nov 12, 2012 at 10:40 PM, Jodi Curtis<br>
> <<a href="mailto:jodi.curtis@gmail.com">jodi.curtis@gmail.com</a>> wrote:<br>
> Hi I'm going through the process now logging<br>
> everything I am doing.<br>
><br>
><br>
> The VM does start BTW, the problem is that it<br>
> cannot open the secure channel from<br>
> remote-viewer attempts to connect, with qemu<br>
> giving those errors in VM11.log. I will post<br>
> my new attempt here anyway in a little while,<br>
> with a success or failure, I've had some minor<br>
> issues with the pki directory, hence removing<br>
> and and trying again with fully checked<br>
> permissions.<br>
><br>
> Thanks for the help.<br>
><br>
><br>
> On Mon, Nov 12, 2012 at 10:12 PM, David Jaša<br>
> <<a href="mailto:djasa@redhat.com">djasa@redhat.com</a>> wrote:<br>
> Jodi Curtis píše v Po 12. 11. 2012 v<br>
> 19:47 +0000:<br>
> > hi<br>
> ><br>
> ><br>
> > sorry I should explain that I used<br>
> squealer as the server name which<br>
> > matches the hostname, this is<br>
> aliased to various ip's and domain<br>
> names<br>
> > in hosts, the usual method, I'll<br>
> check the local ip is listed in there<br>
> > though,I could try the local ip used<br>
> to connect .<br>
> ><br>
><br>
><br>
> Well, all of these are side problems<br>
> as long as your VMs refuse to<br>
> start... Anyway, given that spice<br>
> knows how to override the CN check<br>
> since its very beginnings (using<br>
> --spice-host-subject option), this is<br>
> no big deal, it's just more convenient<br>
> if you don't have to.<br>
><br>
> ><br>
> > yes the keys were created in the<br>
> correct directory<br>
><br>
><br>
> and you already stated that.<br>
><br>
> The error message is pretty clear<br>
> though: there is either something<br>
> wrong with certificates themselves or<br>
> qemu can not access them. If you<br>
> can see details of all of them using<br>
> CLI tools, then the certificates<br>
> should be ok. You could verify that<br>
> ultimately by trying to run<br>
> minimalistic qemu manually:<br>
><br>
> $ sudo /usr/bin/kvm -monitor stdio<br>
> -spice<br>
> tls-port=5800,x509-dir=/etc/pki/libvirt-spice,disable-ticketing<br>
><br>
> you should see just a message like<br>
> this:<br>
> QEMU 0.12.1 monitor - type 'help' for<br>
> more information<br>
> (qemu)<br>
><br>
> If you see the same error again, there<br>
> is something wrong with<br>
> certificates themselves. If not,<br>
> verify that they are accessible to the<br>
> qemu process - note that it may run<br>
> under different user than root and<br>
> in addition, it may be confined by<br>
> SELinux or AppArmor. I can't speak<br>
> for AppArmor but for SELinux, you may<br>
> need to restore context of the<br>
> files (and directories) to make them<br>
> accessible for qemu.<br>
><br>
> David<br>
><br>
> ><br>
> > On Mon, Nov 12, 2012 at 7:42 PM,<br>
> David Jaša <<a href="mailto:djasa@redhat.com">djasa@redhat.com</a>> wrote:<br>
> > Jodi Curtis píše v Po 12.<br>
> 11. 2012 v 18:53 +0000:<br>
> > > Hi<br>
> > ><br>
> > ><br>
> > > Package and OS<br>
> > ><br>
> ------------------------------<br>
> > > Ubuntu 12.10<br>
> > ><br>
> > > qemu-kvm-spice:<br>
> > > Installed:<br>
> 1.2.0-2012.09-0ubuntu1<br>
> > > Candidate:<br>
> 1.2.0-2012.09-0ubuntu1<br>
> > > Version table:<br>
> > > ***<br>
> 1.2.0-2012.09-0ubuntu1 0<br>
> > > 500<br>
> <a href="http://gb.archive.ubuntu.com/ubuntu/" target="_blank">http://gb.archive.ubuntu.com/ubuntu/</a><br>
> > quantal/universe<br>
> > > amd64 Packages<br>
> > ><br>
> 100 /var/lib/dpkg/status<br>
> > ><br>
> > ><br>
> > > Key Creation<br>
> > ><br>
> > > -------------------------<br>
> > ><br>
> > ><br>
> > > openssl genrsa -des3 -out<br>
> ca-key.pem 1024<br>
> > > openssl req -new -x509<br>
> -days 1095 -key ca-key.pem -out<br>
> > ca-cert.pem<br>
> > > -utf8 -subj<br>
> "/C=IL/L=Raanana/O=Red Hat/CN=my CA"<br>
> > > openssl genrsa -out<br>
> server-key.pem 1024<br>
> > > openssl req -new -key<br>
> server-key.pem -out server-key.csr<br>
> > -utf8 -subj<br>
> > > "/C=IL/L=Raanana/O=Red<br>
> Hat/CN=my server"<br>
> ><br>
> ><br>
> > (side note here: you can<br>
> omit C, L and O fields are redundant<br>
> > for uses<br>
> > outside of controlled<br>
> environments but CN field should<br>
> contain<br>
> > hostname<br>
> > or IP address of your server<br>
> so that you don't need to<br>
> > override the host<br>
> > subject)<br>
> ><br>
> > > openssl x509 -req -days<br>
> 1095 -in server-key.csr -CA<br>
> > ca-cert.pem -CAkey<br>
> > > ca-key.pem -set_serial 01<br>
> -out server-cert.pem<br>
> > > openssl rsa -in<br>
> server-key.pem -out<br>
> server-key.pem.insecure<br>
> > > mv server-key.pem<br>
> server-key.pem.secure<br>
> > > mv server-key.pem.insecure<br>
> server-key.pem<br>
> > ><br>
> ><br>
> ><br>
> > here,<br>
> ><br>
> > ><br>
> > > qemu.conf<br>
> > ><br>
> > > --------------<br>
> > ><br>
> > ><br>
> > > qemu.conf configuration<br>
> was attempted as default, and<br>
> > specified using<br>
> > > an uncommented path<br>
> "/etc/pki/libvirt-spice"<br>
> > ><br>
> ><br>
> ><br>
> > here,<br>
> ><br>
> > ><br>
> > > spice_tls = 1<br>
> > ><br>
> > > # default it to keep them<br>
> in /etc/pki/libvirt-spice. This<br>
> > directory<br>
> > ><br>
> > > # must contain<br>
> > ><br>
> > > ...<br>
> > ><br>
> > > #spice_tls_x509_cert_dir =<br>
> "/etc/pki/libvirt-spice" (using<br>
> > the default<br>
> > > path)<br>
> > ><br>
> > > spice_tls_x509_cert_dir =<br>
> ><br>
> "/etc/pki/libvirt-spice" (specifiying<br>
> the<br>
> > > path directly)<br>
> > ><br>
> ><br>
> ><br>
> > and here are the key points.<br>
> Did you copy the<br>
> > {ca,server}-{key,cert}.pem<br>
> > files<br>
> to /etc/pki/libvirt-spice?<br>
> ><br>
> > David<br>
> ><br>
> > ><br>
> > > Permissions<br>
> > ><br>
> > > -------------<br>
> > ><br>
> > > Permissions were tested<br>
> set as default (assumed root or my<br>
> > account)<br>
> > > and<br>
> > ><br>
> > > sudo chown<br>
> libvirt-qemu /etc/pki/libvirt-spice/<br>
> > ><br>
> > > sudo chown<br>
> libvirt-qemu /etc/pki/libvirt-spice/<filenames of<br>
> > files><br>
> > ><br>
> > ><br>
> > ><br>
> > > Error Reported<br>
> > > -------------------------<br>
> > ><br>
> > ><br>
> > > sudo<br>
> nano /var/log/libvirt/qemu/VM11.log<br>
> > ><br>
> > ><br>
> > > qemu: terminating on<br>
> signal 15 from pid 1417<br>
> > > 2012-11-12 18:11:24.586<br>
> +0000: shutting down<br>
> > > 2012-11-12 18:11:29.698<br>
> +0000: starting up<br>
> > > LC_ALL=C<br>
> > ><br>
> ><br>
> PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin<br>
> > ><br>
> QEMU_AUDIO_DRV=spice /usr/bin/kvm<br>
> -name VM11 -S -M pc-1.2<br>
> > -cpu<br>
> > > Opteron_G3,+ibs,+osvw,<br>
> +3dnowprefetch,+cr8legacy,+extapic,<br>
> > +cmp_legacy,<br>
> > > +3dnow,+3dnowext,+pdpe1gb,<br>
> +fxsr_opt,+mmxext,+ht,+vme<br>
</div></div><div class="HOEnZb"><div class="h5">> > -enable-kvm -m<br>
> > > 2048 -smp<br>
> 1,sockets=1,cores=1,threads=1 -uuid<br>
> > ><br>
> 35a6984d-0b77-da48-770e-a8fb0c7c284d<br>
> -no-user-config<br>
> > -nodefaults<br>
> > > -chardev<br>
> > ><br>
> ><br>
> socket,id=charmonitor,path=/var/lib/libvirt/qemu/VM11.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-disk0,if=none,id=drive-virtio-disk0,format=raw,cache=writeback -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=3 -drive file=/var/lib/libvirt/local/dynamic-pool0/buildsvr-disk1,if=none,id=drive-virtio-disk1,format=raw,cache=writethrough -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=4 -drive if=none,id=drive-ide0-0-0,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive file=/var/lib/libvirt/local/fixed-pool0/buildsvr-media,if=none,id=drive-ide0-0-1,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=1 -netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=22 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:1a:b3:4c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -spice port=5908,tls-port=5918,addr=0.0.0.0,agent-mouse=on,disable-ticketing,x509-dir=/etc/pki/libvirt-spice,tls-channel=main,plaintext-channel=display,plaintext-channel=inputs,plaintext-channel=cursor,plaintext-channel=playback,plaintext-channel=record,plaintext-channel=usbredir,image-compression=auto_glz,streaming-video=filter -k en-gb -vga qxl -global qxl-vga.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5<br>
> > > char device redirected<br>
> to /dev/pts/1<br>
> > > ((null):1916):<br>
> Spice-Warning **:<br>
> reds.c:3307:reds_init_ssl:<br>
> > Could not<br>
> > > load certificates<br>
> ><br>
> from /etc/pki/libvirt-spice/server-cert.pem<br>
> > > ((null):1916):<br>
> Spice-Warning **:<br>
> reds.c:3317:reds_init_ssl:<br>
> > Could not<br>
> > > use private key file<br>
> > > ((null):1916):<br>
> Spice-Warning **:<br>
> reds.c:3325:reds_init_ssl:<br>
> > Could not<br>
> > > use CA<br>
> file /etc/pki/libvirt-spice/ca-cert.pem<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > Certificates<br>
> > > --------------------<br>
> > > I was able to open and<br>
> read the files using the various<br>
> > commands<br>
> > > similar to sudo openssl<br>
> x509 -noout -text -in ca-cert.pem<br>
> > ><br>
> > ><br>
> > > I did wonder if it is<br>
> rejecting the CA as some security<br>
> > feature, I<br>
> > > hope this is of use.<br>
> > > I chose libvirt-qemu, as<br>
> this is the account closed to the<br>
> > Red<br>
> > > Hat/Fedora account name<br>
> used "qemu"<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > Creation<br>
> > > ---------------<br>
> > ><br>
> > ><br>
> > > creation was via an XML<br>
> definition followed by calling virsh<br>
> > define<br>
> > > <path>, virsh start VM11<br>
> > ><br>
> > ><br>
> > > I have tried to keep most<br>
> files inside the libvirt tree to<br>
> > try to<br>
> > > avoid permission errors,<br>
> the configuration has two volume<br>
> > pools,<br>
> > > specified<br>
> inside /var/lib/libvirt/local/<pool-name> (which<br>
> > are mounted<br>
> > > to other drives, and<br>
> operate without problem)<br>
> > ><br>
> > ><br>
> > > The volumes used are vmdk<br>
> volumes (for performance reasons)<br>
> > one inside<br>
> > > each pool, for fixed<br>
> allocation and sparse type<br>
> allocation),<br>
> > not that<br>
> > > this matters but it gives<br>
> you an idea of what the setup is<br>
> > like.<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > Location content<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> jodic@squealer:/etc/pki/libvirt-spice$<br>
> dir<br>
> > > ca-cert.pem<br>
> server-cert.pem server-key.pem<br>
> > > ca-key.pem<br>
> server-key.csr server-key.pem.secure<br>
> > ><br>
> > ><br>
> > > I could try using a<br>
> location without the qemu tree to try<br>
> to<br>
> > rule out<br>
> > > some permission problems.<br>
> I'll go through it again in a<br>
> > little bit<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > On Mon, Nov 12, 2012 at<br>
> 6:11 PM, David Jaša<br>
> > <<a href="mailto:djasa@redhat.com">djasa@redhat.com</a>> wrote:<br>
> > > Before reporting a<br>
> bug, could we rule out<br>
> > misconfiguration<br>
> > > possiblity<br>
> > > entirely?<br>
> > ><br>
> > > 1) do you use<br>
> libvirt?<br>
> > > 2) if so, do you<br>
> use system session or per-user<br>
> > session?<br>
> > > 3) could you look<br>
> at qemu command line? If you use<br>
> > libvirt,<br>
> > > you'll find it<br>
> in /var/log/libvirt/qemu/VM_NAME.log<br>
> > > 4) at the libvirt<br>
> command file, is there '...<br>
> > ><br>
> -spice ...,x509-(dir|ca...|server),...<br>
> ' entry?<br>
> > > 5) if the x509<br>
> directive is x509-dir, does "qemu-kvm<br>
> > -spice<br>
> > ><br>
> tls-port=12345,x509-dir=DIR,disable-ticketing"<br>
> > command throw<br>
> > > the same error?<br>
> > > (the same goes<br>
> for per-file x509 options)<br>
> > > 6) if it is indeed<br>
> a problem, is it permission issue<br>
> > or are<br>
> > > the files empty or<br>
> are they invalid?<br>
> > ><br>
> > > (...)<br>
> > ><br>
> > > David<br>
> > ><br>
> > ><br>
> > > Jodi Curtis píše v<br>
> Po 12. 11. 2012 v 17:55 +0000:<br>
> > > > Hi<br>
> > > ><br>
> > > ><br>
> > > > I've used the<br>
> directory correctly on qemu.conf,<br>
> > I've seen<br>
> > > these<br>
> > > > problems<br>
> relating to Red Hat/oVirt, where it<br>
> > wasn't set<br>
> > > despite being<br>
> > > > set in<br>
> qemu.conf, so I will probably file a<br>
> bug<br>
> > report with<br>
> > > Ubuntu on<br>
> > > > this one.<br>
> > > ><br>
> > > ><br>
> > > > The red-hat<br>
> solution isn't valid for Ubuntu.<br>
> > > ><br>
> > > ><br>
> > > > Thanks<br>
> > > ><br>
> > > > On Mon, Nov 12,<br>
> 2012 at 5:49 PM, David Jaša<br>
> > > <<a href="mailto:djasa@redhat.com">djasa@redhat.com</a>><br>
> wrote:<br>
> > > > Jodi<br>
> Curtis píše v Po 12. 11. 2012 v 17:31<br>
> > +0000:<br>
> > > > > Hi<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> Thanks, I found the method in the end,<br>
> > my current<br>
> > > problem is<br>
> > > > related<br>
> > > > > to a<br>
> problem with Ubuntu/SSL/Spice, so<br>
> > not really<br>
> > > your<br>
> > > ><br>
> software, I<br>
> > > > > have<br>
> asked for help from a Linux admin,<br>
> > but its<br>
> > > detailed<br>
> > > > below<br>
> for the<br>
> > > > ><br>
> record, I've gone through the key<br>
> making<br>
> > proces<br>
> > > twice, and<br>
> > > ><br>
> rebooted,<br>
> > > > ><br>
> obviously paths have been checked and<br>
> > qemu.conf<br>
> > > has been set<br>
> > > > as<br>
> > > > ><br>
> required<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> ((null):2176): Spice-Warning **:<br>
> > ><br>
> reds.c:3307:reds_init_ssl:<br>
> > > > Could<br>
> not<br>
> > > > > load<br>
> certificates from server-cert.pem<br>
> > > > ><br>
> ((null):2176): Spice-Warning **:<br>
> > ><br>
> reds.c:3317:reds_init_ssl:<br>
> > > > Could<br>
> not<br>
> > > > > use<br>
> private key file<br>
> > > > ><br>
> ((null):2176): Spice-Warning **:<br>
> > ><br>
> reds.c:3325:reds_init_ssl:<br>
> > > > Could<br>
> not<br>
> > > > > use CA<br>
> file<br>
> > > ><br>
> > > ><br>
> > > > Assuming<br>
> that your cert/key files are<br>
> > correct and in<br>
> > > place,<br>
> > > > this<br>
> looks<br>
> > > > like<br>
> incorrect x509-dir option of qemu cli<br>
> > or<br>
> > > ><br>
> spice_tls_x509_cert_dir<br>
> > > ><br>
> directive of /etc/libvirt/qemu.conf<br>
> > pointing to a<br>
> > > wrong<br>
> > > ><br>
> directory. Just<br>
> > > > a<br>
> configuration issue.<br>
> > > ><br>
> > > > David<br>
> > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > There<br>
> is very little obvious on the<br>
> > internet, so<br>
> > > am trying<br>
> > > > to<br>
> identify<br>
> > > > > if its<br>
> a common SSL or config problem,<br>
> > or if I<br>
> > > should file a<br>
> > > > bug<br>
> > > > > report<br>
> with Ubuntu kvm-spice<br>
> > > > ><br>
> > > > ><br>
> > > > > Jodi<br>
> > > > ><br>
> > > > ><br>
> > > > > On<br>
> Mon, Nov 12, 2012 at 12:12 PM, David<br>
> > Jaša<br>
> > > ><br>
> <<a href="mailto:djasa@redhat.com">djasa@redhat.com</a>> wrote:<br>
> > > > ><br>
> Hi Jodi,<br>
> > > > ><br>
> > > > ><br>
> You can find full tls-enabled<br>
> > > remote-viewer<br>
> > > ><br>
> invocation in this<br>
> > > > ><br>
> oVirt<br>
> > > > ><br>
> wiki page:<br>
> > > > ><br>
> > > ><br>
> > ><br>
> ><br>
> <a href="http://wiki.ovirt.org/wiki/How_to_Connect_to_SPICE_Console_Without_Portal" target="_blank">http://wiki.ovirt.org/wiki/How_to_Connect_to_SPICE_Console_Without_Portal</a><br>
> > > > ><br>
> > > > ><br>
> David<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> Jodi Curtis píše v Ne 11. 11.<br>
> > 2012 v 23:28<br>
> > > +0000:<br>
> > > > ><br>
> > Hi<br>
> > > > ><br>
> ><br>
> > > > ><br>
> ><br>
> > > > ><br>
> > I'm having trouble connecting<br>
> > to a spice<br>
> > > server<br>
> > > > with tls<br>
> > > > ><br>
> enabled<br>
> > > > ><br>
> > through virt-viewer on<br>
> > windows, I have<br>
> > > tls<br>
> > > ><br>
> configured and a<br>
> > > > ><br>
> > ca-cert.pem file, but I don't<br>
> > know where<br>
> > > to put<br>
> > > > it, or<br>
> what<br>
> > > > ><br>
> to use<br>
> > > > ><br>
> ><br>
> > > > ><br>
> ><br>
> > > > ><br>
> > I have tried various<br>
> > combinations of<br>
> > > > ><br>
> spice://192.168.2.140:590x<br>
> > > > ><br>
> ><br>
> > > > ><br>
> ><br>
> > > > ><br>
> > I have tried adding +ssh or<br>
> > +tls, I have<br>
> > > tried<br>
> > > > adding<br>
> the<br>
> > > > ><br>
> ca-cert.pem<br>
> > > > ><br>
> > file to the location used by<br>
> > the spicec<br>
> > > page that<br>
> > > > covers<br>
> how<br>
> > > > ><br>
> to set up<br>
> > > > ><br>
> > tls, and I have tried adding<br>
> > my username<br>
> > > before<br>
> > > > the IP.<br>
> > > > ><br>
> ><br>
> > > > ><br>
> > I have tried connecting to<br>
> > both ports.<br>
> > > > ><br>
> ><br>
> > > > ><br>
> ><br>
> > > > ><br>
> > Any help on what it should be,<br>
> > or if<br>
> > > there is an<br>
> > > ><br>
> alternative<br>
> > > > ><br>
> to<br>
> > > > ><br>
> > virt-viewer on windows that I<br>
> > need to<br>
> > > use for the<br>
> > > > secure<br>
> > > > ><br>
> connection.<br>
> > > > ><br>
> ><br>
> > > > ><br>
> ><br>
> > > > ><br>
> > Thanks<br>
> > > > ><br>
> > > > ><br>
> ><br>
> > ><br>
> _______________________________________________<br>
> > > > ><br>
> > Spice-devel mailing list<br>
> > > > ><br>
> ><br>
> ><br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> > > > ><br>
> ><br>
> > > ><br>
> > ><br>
> ><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > > ><br>
> > > > ><br>
> --<br>
> > > > ><br>
> > > > ><br>
> David Jaša, RHCE<br>
> > > > ><br>
> > > > ><br>
> SPICE QE based in Brno<br>
> > > > ><br>
> GPG Key: 22C33E24<br>
> > > > ><br>
> Fingerprint: 513A 060B D1B4 2A72<br>
> > 7F0D 0278<br>
> > > B125 CD00<br>
> > > > 22C3<br>
> 3E24<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> ><br>
> _______________________________________________<br>
> > > > ><br>
> Spice-devel mailing list<br>
> > > > ><br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> > > > ><br>
> > ><br>
> ><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> > > ><br>
> > > > --<br>
> > > ><br>
> > > > David<br>
> Jaša, RHCE<br>
> > > ><br>
> > > > SPICE QE<br>
> based in Brno<br>
> > > > GPG Key:<br>
> 22C33E24<br>
> > > ><br>
> Fingerprint: 513A 060B D1B4 2A72 7F0D<br>
> 0278<br>
> > B125 CD00<br>
> > > 22C3 3E24<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > ><br>
> > > --<br>
> > ><br>
> > > David Jaša, RHCE<br>
> > ><br>
> > > SPICE QE based in<br>
> Brno<br>
> > > GPG Key:<br>
> 22C33E24<br>
> > > Fingerprint: 513A<br>
> 060B D1B4 2A72 7F0D 0278 B125 CD00<br>
> > 22C3 3E24<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> _______________________________________________<br>
> > > Spice-devel mailing list<br>
> > ><br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> > ><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
> ><br>
> > --<br>
> ><br>
> > David Jaša, RHCE<br>
> ><br>
> > SPICE QE based in Brno<br>
> > GPG Key: 22C33E24<br>
> > Fingerprint: 513A 060B D1B4<br>
> 2A72 7F0D 0278 B125 CD00 22C3 3E24<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > Spice-devel mailing list<br>
> > <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> ><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
><br>
> --<br>
><br>
> David Jaša, RHCE<br>
><br>
> SPICE QE based in Brno<br>
> GPG Key: 22C33E24<br>
> Fingerprint: 513A 060B D1B4 2A72 7F0D<br>
> 0278 B125 CD00 22C3 3E24<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
<br>
--<br>
<br>
David Jaša, RHCE<br>
<br>
SPICE QE based in Brno<br>
GPG Key: 22C33E24<br>
Fingerprint: 513A 060B D1B4 2A72 7F0D 0278 B125 CD00 22C3 3E24<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div></div>