Hi all:
I tried kvm on my ubuntu with the libvirt.xml file as follows:
<domain type='kvm'>
<name>instance-00000011</name>
<memory>2097152</memory>
<os>
<type>hvm</type>
<boot dev="hd" />
</os>
<features>
<acpi/>
</features>
<vcpu>1</vcpu>
<devices>
<sound model='ac97'/>
<input type='tablet' bus='usb'/>
<disk type='file'>
<driver type='qcow2'/>
<source
file='/opt/stack/nova/nova/../
/instances/instance-00000011/disk'/>
<target dev='vda' bus='ide'/>
</disk>
<disk type='file'>
<driver type='qcow2'/>
<source
- Ignored:
file='/opt/stack/nova/nova/..//instances/instance-00000011/disk.local'/>
<target dev='vdb' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='br100'/>
<mac address='02:16:3e:44:a1:dd'/>
<filterref
filter="nova-instance-instance-00000011-02163e44a1dd">
<parameter name="IP" value="10.0.0.2" />
<parameter name="DHCPSERVER" value="10.0.0.1"
/>
</filterref>
</interface>
<!-- The order is significant here. File must be defined first
-->
<serial type="file">
<source
path='/opt/stack/nova/nova/..//instances/instance-00000011/console.log'/>
<target port='1'/>
</serial>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
<serial type='pty'>
<source path='/dev/pts/2'/>
<target port='0'/>
</serial>
<graphics type='vnc' port='-1' autoport='yes'
keymap='en-us'
listen='0.0.0.0'/>
</devices>
</domain>
So it works well.
Howerver, I want change the remote access method by spice, I simply
changed
the libvirt.xml as follows:
<domain type='kvm'>
<name>instance-00000011</name>
<memory>2097152</memory>
<os>
<type>hvm</type>
<boot dev="hd" />
</os>
<features>
<acpi/>
</features>
<vcpu>1</vcpu>
<devices>
<sound model='ac97'/>
<input type='tablet' bus='usb'/>
<disk type='file'>
<driver type='qcow2'/>
<source
file='/opt/stack/nova/nova/..//instances/instance-00000011/disk'/>
<target dev='vda' bus='ide'/>
</disk>
<disk type='file'>
<driver type='qcow2'/>
<source
file='/opt/stack/nova/nova/..//instances/instance-00000011/disk.local'/>
<target dev='vdb' bus='ide'/>
</disk>
<interface type='bridge'>
<source bridge='br100'/>
<mac address='02:16:3e:44:a1:dd'/>
<filterref
filter="nova-instance-instance-00000011-02163e44a1dd">
<parameter name="IP" value="10.0.0.2" />
<parameter name="DHCPSERVER" value="10.0.0.1"
/>
</filterref>
</interface>
<!-- The order is significant here. File must be defined first
-->
<serial type="file">
<source
path='/opt/stack/nova/nova/..//instances/instance-00000011/console.log'/>
<target port='1'/>
</serial>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
<serial type='pty'>
<source path='/dev/pts/2'/>
<target port='0'/>
</serial>
<graphics type='spice' port='-1' autoport='yes'
keymap='en-us'
listen='0.0.0.0'/>
</devices>
</domain>
As you can see, I just change <graphics type='vnc' port='-1'
autoport='yes'
keymap='en-us' listen='0.0.0.0'/> to <graphics
type='spice' port='-1'
autoport='yes' keymap='en-us' listen='0.0.0.0'/> , But
it called the
error as follows:
libvirtError: internal error Process exited while reading console log
output: char device redirected to /dev/pts/12
TRACE: do_spice_init: starting 0.8.1
TRACE: do_spice_init: statistics shm_open failed, Permission denied"
I wish someone can give me some help! Thanks!