[libvirt-users] Broken OS when booting rootfs from 9p share

Olivier Mauras olivier at mauras.ch
Thu Feb 26 15:49:12 UTC 2015


 

On 2015-02-26 17:05, Kashyap Chamarthy wrote: 

> On Tue, Feb 24,
2015 at 11:56:50PM +0100, Olivier Mauras wrote:
> 
>> On Tue, 2015-02-24
at 16:05 -0500, Laine Stump wrote: 
>> 
>>> On 02/24/2015 03:37 PM,
Olivier Mauras wrote: 
>>> 
>>>>> Hello, I've been trying to boot a VM
with the rootfs being a 9P share from the host. The VM OS is centos 7.
The OS boots but no services can work and it appears that the
authentication system is broken. Now the funny thing is that booting the
same OS on the same 9P share manually with Qemu works as expected with a
fully functionnal OS... So I'm wondering what could libvirt do that
render the OS on the share broken - Something with rights ? Selinux is
disabled on the host, and accessmode to the share is set to passthrough
in both cases. Here's my working Qemu line: qemu -kernel
/srv/overlay/kernels/grsec-3.14.33-101/vmlinuz-3.14.33-101.el6.x86_64
-initrd
/srv/overlay/kernels/grsec-3.14.33-101/initramfs-3.14.33-101.el6.x86_64.img
-fsdev local,id=r,path=/srv/overlay/run/irc,security_model=passthrough
-device virtio-9p-pci,fsdev=r,mount_tag=root -nographic -m 256M -machine
pc-i440fx-2.1,accel=kvm -netdev tap,id=net0 -device
virtio-net,netdev=net0,mac=52:54:00:12:36:34 -smp 1,sockets=1,cores=1
-append 'root=virtfs:root rootflags=trans=virtio,version=9p2000.u ro
rootfstype=9p console=ttyS0' And here my libvirt VM
config:ircffbd32eb-a693-eadd-8923-18de801374722621442621441hvm/srv/overlay/kernels/grsec-3.14.33-101/vmlinuz-3.14.33-101.el6.x86_64/srv/overlay/kernels/grsec-3.14.33-101/initramfs-3.14.33-101.el6.x86_64.imgroot=virtfs:root
rootflags=trans=virtio,version=9p2000.u ro
rootfstype=9pdestroyrestartrestart/usr/bin/qemu-system-x86_64 My libvirt
version is 1.2.9, and qemu is 2.1.2. Thanks for your help, Olivier
_______________________________________________ libvirt-users mailing
list libvirt-users at redhat.com [1]
https://www.redhat.com/mailman/listinfo/libvirt-users [2]
>>>> So I
updated libvirt to 1.2.12 and qemu to 2.1.3 and it still gives me the
exact same behaviour ... Could it be that the share was created with an
old version of virt-manager redenring in old/broken XML? From Qemu
config example i don't see how my XML could be incorrect. Any idea ?
>>>
I know nothing about the 9p filesystem, but since you have a qemu
commandline that works and a libvirt config that doesn't, the next
logical step would be to provide the non-working qemu commandline
generated by libvirt. You can find this at the end of the log file
/var/log/libvirt/qemu/irc.log.
>> Here it is... A bit more complex :)
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none
/usr/bin/qemu-system-x86_64 -name irc -S -machine
pc-i440fx-2.1,accel=kvm,usb=off -m 256 -realtime mlock=off -smp
1,sockets=1,cores=1,threads=1 -uuid ffbd32eb-a693-eadd-8923-18de80137472
-no-user-config -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/irc.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -no-acpi -boot strict=on -kernel
/srv/overlay/kernels/grsec-3.14.33-101/vmlinuz-3.14.33-101.el6.x86_64
-initrd
/srv/overlay/kernels/grsec-3.14.33-101/initramfs-3.14.33-101.el6.x86_64.img
-append root=virtfs:root rootflags=trans=virtio,version=9p2000.u rw
rootfstype=9p -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-fsdev
local,security_model=passthrough,id=fsdev-fs0,path=/srv/overlay/run/irc
-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=root,bus=pci.0,addr=0x5
-netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=28 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:00:10:10,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:3 -device
cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -msg timestamp=on
> 
>
Maybe you can try enabling Debug logs/filters in libvirt
> 
>
http://wiki.libvirt.org/page/DebugLogs
> 
> and see if that helps you
narrow down?

#!/bin/bash
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin
QEMU_AUDIO_DRV=none /usr/bin/qemu-system-x86_64 -name irc -machine
pc-i440fx-2.1,accel=kvm -m 256 -smp 1,sockets=1,cores=1,threads=1

-no-user-config 
-chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/irc.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot
strict=on 
-kernel
/srv/overlay/kernels/grsec-3.14.33-101/vmlinuz-3.14.33-101.el6.x86_64

-initrd
/srv/overlay/kernels/grsec-3.14.33-101/initramfs-3.14.33-101.el6.x86_64.img

-append 'root=virtfs:root rootflags=trans=virtio,version=9p2000.u rw
rootfstype=9p console=ttyS0' 
-fsdev
local,security_model=passthrough,id=fsdev-fs0,path=/srv/overlay/run/irc
-nographic 
-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=root,bus=pci.0,addr=0x5

-chardev stdio,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device
cirrus-vga,id=video0,bus=pci.0,addr=0x3 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -msg
timestamp=on

This gives me the same result as my first qemu command.
Seems that -nodefaults gives me non booted state VM. 




Links:
------
[1] mailto:libvirt-users at redhat.com
[2]
https://www.redhat.com/mailman/listinfo/libvirt-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150226/9c235815/attachment.htm>


More information about the libvirt-users mailing list