[libvirt-users] Libvirt, virtmanager & Windows 7 installation partition

Roland Giesler roland at giesler.za.net
Fri Jul 5 08:04:46 UTC 2013


On Fri, Jul 5, 2013 at 7:30 AM, Laine Stump <laine at laine.org> wrote:
> On 07/04/2013 04:21 PM, Roland Giesler wrote:
>> I need to use an existing windows 7 installation in a virtual machine
>> form a libvirt host running Ubuntu 12.10.
<snip>
>
> While what you're seeing with a failure this early in the boot process
> may have something to do with disk geometry or naming, note that booting
> an existing Windows installation as a virtual machine is fraught with
> peril. This is because Windows tailors what it installs on a particular
> machine to the hardware of the machine at the time of the installation.
> A virtual machine is *not* the same as the physical machine it is
> running on (for example, qemu virtual machines currently all use the
> i440FX chipset, which hasn't been manufactured in probably 15 years or
> so), so if you try to boot an installation created on real (and
> certainly much more modern) hardware in a virtual machine, Windows will
> see the difference and could "freak out"; the result could be something
> as innocuous as automatically installing some new drivers for the "new
> hardware" it has found, or it could require you to re-activate your copy
> of Windows (whatever that entails these days - the newest Windows that
> I've run is WinXP :-P), or it could result in a total disaster of a
> failure to boot or blue screen.

I get exactly what you mean, Laine, yes.  Thanks for the
clarification.  I was expecting at least some form of Windows OS
response though, not just the libvirt messages.

>
> There is a package called "virt-p2v that can help in converting an
> existing Windows installation over so that it will run properly under
> qemu (it mounts the image from Linux and injects new/different drivers
> and registry changes). However, this is a permanent, one way process -
> once you've done this to a Windows installation, you can't go back and
> run it directly on hardware. (well, that's actually glossing things over
> a bit; I believe the way virt-p2v works is to make a *copy* of the
> original machine's disk, then modify that copy so the original is still
> there, but then you have two copies, and changes to one will not be
> registered in the other... you see the problem).
>
> So if you're willing to permanently use this windows installation only
> as a virtual machine, you should look into virt-p2v (at least to see the
> kind of stuff it does). If you're not willing to make a permanent
> switch, you may want to rethink your goals.

I could create a Win7 VM (I have enough disk space for this), but
there are games and things installed in the Win7 installation (which
my adult son doesn't want to loose! LOL), so I'm going to have
navigate this one carefully. :-)  I suspect that if I convert this
permanently, the VM will be substantially slower since the laptop
processor doesn't support hardware virt extensions, so games won't run
very well.

>
>
>>
>> Here is what /var/log/syslog has:
>>
>> Jul  4 22:11:02 Matt-HP ntfs-3g[8385]: Version 2012.1.15AR.5 external FUSE 29
>> Jul  4 22:11:02 Matt-HP ntfs-3g[8385]: Mounted /dev/sda2 (Read-Write,
>> label "", NTFS 3.1)
>> Jul  4 22:11:02 Matt-HP ntfs-3g[8385]: Cmdline options:
>> rw,nosuid,nodev,uhelper=udisks2,uid=1001,gid=1001,dmask=0077,fmask=0177
>> Jul  4 22:11:02 Matt-HP ntfs-3g[8385]: Mount options:
>> rw,nosuid,nodev,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sda2,blkdev,blksize=4096
>> Jul  4 22:11:02 Matt-HP ntfs-3g[8385]: Global ownership and
>> permissions enforced, configuration type 7
>> Jul  4 22:11:02 Matt-HP udisksd[2569]: Mounted /dev/sda2 at
>> /media/roland/BE26AE8326AE3C71 on behalf of uid 1001
>
> Wait! This is another problem - you can't mount the device in the host
> OS *and* try to use it as a block device for a virtual guest! If you
> manage to be successful in booting the guest, you'll then have two
> independent entities modifying the same file system at the same time,
> which will lead to disaster in the form of a corrupt disk very quickly.
>
> If you're going to use a disk in a guest, don't mount it in the host,
> and if you're going to mount it in the host, don't use it in a guest.

I'll have to investigate why that happens since I don't have that
partition mounted intentionally!


>
>> Jul  4 22:12:31 Matt-HP kernel: [15366.356259] audit_printk_skb: 48
>> callbacks suppressed
>> Jul  4 22:12:31 Matt-HP kernel: [15366.356265] type=1400
>> audit(1372968751.291:34): apparmor="STATUS" operation="profile_load"
>> name="libvirt-c6a90ff5-9849-2ec5-fc8e-a331b144ceff" pid=8540
>> comm="apparmor_parser"
>> Jul  4 22:12:31 Matt-HP kernel: [15366.584252] device vnet0 entered
>> promiscuous mode
>> Jul  4 22:12:31 Matt-HP kernel: [15366.588663] virbr0: topology change
>> detected, propagating
>> Jul  4 22:12:31 Matt-HP kernel: [15366.588669] virbr0: port 1(vnet0)
>> entered forwarding state
>> Jul  4 22:12:31 Matt-HP kernel: [15366.588685] virbr0: port 1(vnet0)
>> entered forwarding state
>> Jul  4 22:12:31 Matt-HP kernel: [15366.588963] IPv6:
>> ADDRCONF(NETDEV_CHANGE): virbr0: link becomes ready
>> Jul  4 22:12:31 Matt-HP NetworkManager[986]:    SCPlugin-Ifupdown:
>> devices added (path: /sys/devices/virtual/net/vnet0, iface: vnet0)
>> Jul  4 22:12:31 Matt-HP NetworkManager[986]:    SCPlugin-Ifupdown:
>> device added (path: /sys/devices/virtual/net/vnet0, iface: vnet0): no
>> ifupdown configuration found.
>> Jul  4 22:12:32 Matt-HP NetworkManager[986]: <warn>
>> /sys/devices/virtual/net/vnet0: couldn't determine device driver;
>> ignoring...
>> Jul  4 22:12:33 Matt-HP avahi-daemon[935]: Joining mDNS multicast
>> group on interface vnet0.IPv6 with address fe80::fc54:ff:fe8a:8f93.
>> Jul  4 22:12:33 Matt-HP avahi-daemon[935]: New relevant interface
>> vnet0.IPv6 for mDNS.
>> Jul  4 22:12:33 Matt-HP avahi-daemon[935]: Registering new address
>> record for fe80::fc54:ff:fe8a:8f93 on vnet0.*.
>>
>> Is there anything that I can learn from this log?
>
> Not much (other than that NetworkManager can't seem to keep its mitts of
> of libvirt's tap devices :-/, but that's not related to your problem).
>
> You *might* see something useful in
> /var/log/libvirt/qemu/$guestname.log, but it's unlikely.

This is what I have in /var/log/libvirt/qemu/wind.log

2013-07-04 21:11:31.683+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
QEMU_AUDIO_DRV=none /usr/bin/qemu-system-i386 -name wind -S -M pc-1.2
-no-kvm -m 1024 -smp 2,sockets=2,cores=1,threads=1 -uuid
c6a90ff5-9849-2ec5-fc8e-a331b144ceff -no-user-config -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/wind.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=/dev/sda1,if=none,id=drive-ide0-0-0,format=raw -device
ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
-netdev tap,fd=18,id=hostnet0 -device
rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:8a:8f:93,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
-vnc 127.0.0.1:0 -vga std -device
intel-hda,id=sound0,bus=pci.0,addr=0x4 -device
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
char device redirected to /dev/pts/5
qemu-system-i386: -device
rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:8a:8f:93,bus=pci.0,addr=0x3:
pci_add_option_rom: failed to find romfile "pxe-rtl8139.rom"
qemu: terminating on signal 15 from pid 11974

Would the missing "pxe-rtl8139.rom" stall the process?

> Beyond that, investigating something like this usually requires looking
> at the guest's libvirt config ("virsh dumpxml $guestname"), although in
> this case I think you have much bigger problems.
>
>
>>   What could I do to
>> make this work.  Dual booting it not an option in this case.
>
> As mentioned above - if you're willing to give up native Windows boot
> forever, then look into virt-p2v or something similar. Otherwise, you'll
> have to dual boot, or have two separate Windows images - one for native
> boot and one for booting as a guest.
>
>>
>> Disclaimer: The sender invokes the rule of "exemptus responsibilitus"
>> pertaining to caffeine soluted inductions and/or decantations thereof
>> into tactile communication interfaces and alternative apparatuses with
>> respect to personal computation devices or otherwise implementations
>> of electronic and/or bionic devices. This impartation is intended for
>> the addressed party, unless conditions contrary to the aforementioned
>> exist, in which case it is pertinent.  Reduce without further ado to
>> nothingness said impartation; alternatively "refrain from traversing
>> the point of origination, be not enriched by 200 Randus and proceed
>> without delay to enjailment".
>>
>
> Brilliant!! :-) This makes at least as much sense as the ones that think
> they're serious...

I hate there convoluted sigs one sees especially in business emails.
Here's what my serious business disclaimer says:

Please note: Regretfully we are unable to accept email disclaimers.
Unless otherwise agreed in advance, all mail sent to
thegreentree.za.net becomes ours (generally like anything else sent to
us) and we are free to deal with in any manner we see fit. If you
disagree with this, please consider communicating with us in a way you
may find more suitable.

Thanks for you input so far!

regards

Roland




More information about the libvirt-users mailing list