Windows in KVM irreversibly damaged? (Linux Host)

Hello,
I'm running Fedora 25 and I decided to install Windows 7 in KVM, because I needed to study Windows for my job.
Everything went fine I kept usting the VM for about a week and then I decided to install MS Office 2016. During the installation of MS Office, Windows 7 crashed => black screen.

Now, when I try to run the VM it just goes to the loading screen of Windows and then it crashes.
I also tried repair mode but it also goes to the loading screen and crashes.

I wonder if the virtual drive is full or something like that...
Very weird.

Any ideas?

1 Like

did you give the VM at least 40 GiB of space to work with?

1 Like

Yes, exactly 40GB.

I'd most assuredly run with @Dynamic_Gravity first. But if you run into a wall and it's not a space, memory, or resource issue I lifted the following from https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems

Maybe useful:

Virt Manager stores a logfile in ~/.virt-manager/virt-manager.log.

Also, /var/log/messages may have logged something too.

Hopefully, I'm not steering you into log hell, but maybe some info in there.

EDIT

Another idea might be to tail -f both those files open your windows vm, open task manager - open your office application - monitor the resources via task manager when it opens and then check the logs after it crashes.

I'm not sure I have the answer for you yet but that may give us more info.

2 Likes

This is tail -f /var/log/messages after I start the VM. I cannot run Office because VM crashes at the Windows loading screen. I didn't see anything appear in messages at the time of the crash though. Also I don't have a /.virt-manager/ dir in ~

There are a few mentions of 'Cookie sqlite error 13, errno 0: database or disk is full' in the log but I don't think that's related.

What's weird is that VM status goes from Running to Paused when Windows crashes. If I try to resume it goes to paused again.

Apr 30 17:57:45 localhost audit: ANOM_PROMISCUOUS dev=vnet0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
Apr 30 17:57:45 localhost kernel: br0: port 2(vnet0) entered blocking state
Apr 30 17:57:45 localhost kernel: br0: port 2(vnet0) entered disabled state
Apr 30 17:57:45 localhost kernel: device vnet0 entered promiscuous mode
Apr 30 17:57:45 localhost kernel: br0: port 2(vnet0) entered blocking state
Apr 30 17:57:45 localhost kernel: br0: port 2(vnet0) entered forwarding state
Apr 30 17:57:45 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=net reason=open vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 net=52:54:00:57:bb:e8 path="/dev/net/tun" rdev=0A:C8 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:45 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=cgroup reason=deny vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d6\x2dwinx.scope/" class=all exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:45 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=cgroup reason=allow vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d6\x2dwinx.scope/" class=path path="/var/lib/libvirt/images/win.qcow2" rdev=? acl=rw exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:45 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=cgroup reason=allow vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d6\x2dwinx.scope/" class=major category=pty maj=88 acl=rw exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:45 localhost systemd-machined: New machine qemu-6-winx.
Apr 30 17:57:45 localhost systemd: Started Virtual Machine qemu-6-winx.
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.5374] device (vnet0): state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.5845] keyfile: add connection in-memory (b80de471-3bd3-4e4a-8965-bcc596bcbca4,"vnet0")
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.5875] device (vnet0): state change: unavailable -> disconnected (reason 'connection-assumed') [20 30 41]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.5905] device (vnet0): Activation: starting connection 'vnet0' (b80de471-3bd3-4e4a-8965-bcc596bcbca4)
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6085] device (vnet0): state change: disconnected -> prepare (reason 'none') [30 40 0]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6092] device (vnet0): state change: prepare -> config (reason 'none') [40 50 0]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6096] device (vnet0): state change: config -> ip-config (reason 'none') [50 70 0]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6097] device (br0): bridge port vnet0 was attached
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6097] device (vnet0): Activation: connection 'vnet0' enslaved, continuing activation
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6102] device (vnet0): state change: ip-config -> secondaries (reason 'none') [70 90 0]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.6105] device (vnet0): state change: secondaries -> activated (reason 'none') [90 100 0]
Apr 30 17:57:45 localhost NetworkManager[869]: [1493564265.8458] device (vnet0): Activation: successful, device activated.
Apr 30 17:57:45 localhost dbus-daemon[761]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.9' (uid=0 pid=869 comm="/usr/sbin/NetworkManager --no-daemon ")
Apr 30 17:57:45 localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr 30 17:57:45 localhost dbus-daemon[761]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr 30 17:57:45 localhost audit: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:45 localhost systemd: Started Network Manager Script Dispatcher Service.
Apr 30 17:57:45 localhost nm-dispatcher: req:1 'up' [vnet0]: new request (6 scripts)
Apr 30 17:57:45 localhost nm-dispatcher: req:1 'up' [vnet0]: start running ordered scripts...
Apr 30 17:57:45 localhost systemd: iscsi.service: Unit cannot be reloaded because it is inactive.
Apr 30 17:57:46 localhost avahi-daemon[769]: Joining mDNS multicast group on interface vnet0.IPv6 with address fe80::fc54:ff:fe57:bbe8.
Apr 30 17:57:46 localhost avahi-daemon[769]: New relevant interface vnet0.IPv6 for mDNS.
Apr 30 17:57:46 localhost avahi-daemon[769]: Registering new address record for fe80::fc54:ff:fe57:bbe8 on vnet0.*.
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=disk reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 old-disk="?" new-disk="/var/lib/libvirt/images/win.qcow2" exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=net reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 old-net="?" new-net="52:54:00:57:bb:e8" exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=dev reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 bus=usb device=555342207265646972646576 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=dev reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 bus=usb device=555342207265646972646576 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=chardev reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 old-chardev="?" new-chardev="/dev/pts/1" exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=mem reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 old-mem=0 new-mem=8192000 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_RESOURCE pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=vcpu reason=start vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 old-vcpu=0 new-vcpu=2 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost audit: VIRT_CONTROL pid=898 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm op=start reason=booted vm="winx" uuid=33d8a392-ec19-42ca-934e-906859cbcbd3 vm-pid=9572 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Apr 30 17:57:47 localhost journal: End of file while reading data: Input/output error
Apr 30 17:57:48 localhost /usr/libexec/gdm-x-session: [1996:2088:0430/175748.077253:ERROR:connection.cc(1947)] Cookie sqlite error 13, errno 0: database or disk is full, sql: UPDATE cookies SET last_access_utc=? WHERE creation_utc=?
Apr 30 17:57:48 localhost /usr/libexec/gdm-x-session: [1996:2088:0430/175748.077335:ERROR:connection.cc(1947)] Cookie sqlite error 13, errno 0: database or disk is full, sql: UPDATE cookies SET last_access_utc=? WHERE creation_utc=?
Apr 30 17:57:48 localhost /usr/libexec/gdm-x-session: [1996:2088:0430/175748.077450:ERROR:connection.cc(1947)] Cookie sqlite error 13, errno 0: database or disk is full, sql: UPDATE cookies SET last_access_utc=? WHERE creation_utc=?
Apr 30 17:57:48 localhost /usr/libexec/gdm-x-session: [1996:2088:0430/175748.077499:ERROR:connection.cc(1947)] Cookie sqlite error 13, errno 0: database or disk is full, sql: UPDATE cookies SET last_access_utc=? WHERE creation_utc=?
Apr 30 17:57:56 localhost audit: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

What distro are you using?
When does the machine crash? At the loading screen? After you enter your username/password?
Does it blank screen or does the application crash?
How much RAM does the VM have?
How much RAM does the local machine have?
Can you use top or free to see how much available memory (RAM) you have available without your VM open?

I'm wondering if you don't have enough memory to open your VM, if there is a graphics issue, or if your Windows VM is out of space.

1 Like

Thanks for posting those logs.

I'm going to leave some recommendations of what I'd try if I were in your shoes. I can't make any promises, but I'm going to be away from my machine for awhile. So rather than leave you hanging --- here's where I was going:

1) I'd see if my linux host is running out of memory -> this can be determined by using top or free -h to see how much free memory you have before launching the machine. If it's less than the amount you've allocated to the VM you may have a lack of resources on the host machine.

2) Possibly consider staring the vm on the command line - see if you can't get it throw an error to your terminal. You can do this by:

virsh list --all
virsh start yourWindowsVM

3) Depending on when it crashes, I had issues with VMWare booting with Wayland. If it's crashing when your trying to open the Virt-manager software - You may want to consider switching your Windowing system to GNOME X-Org and see if that works. A quick google search didn't supply an answer if QEMU is compatible with Wayland.

4) Last, but not least, I'm not sure how to check this, besides trying to boot into safemode, but I'd be interested to see if you ran out of room in your virtual HDD for the windows machine. If you did I'm not exactly sure how to find out of how to fix this, but it could be a lead.

Sorry I don't have the answer for you right now, I'll check back in a few hours to see if you've made progress or if any other members have a solution.

1 Like

Turns out the Host was out of disk space on the default partition.
I moved the VM file to another drive and then changed some XML settings to point to the new Dir and now it runs fine.

More info here: https://www.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatsecstorotherdir.htm

Thanks to everyone who helped!

2 Likes

I recommend using a dedicated disk for VMs and my personal preference is to use LVM rather than files for the VM disks. LVM snapshots are really useful, especially when it comes to backing up.

1 Like

This ^^^^^^^

Testing different OSs in space shared with the host OS is ok, but if you plan on doing any work/productivity to a guest OS you are better off with dedicated drive and space, if nothing else it will speed up you read/write times because the control isn't being handed off back and forth between the host and guest systems......snapshots = the holy grail! lol

1 Like

Precisely, the host OS is less of a man in the middle because, other than the kernel LVM process it's not reading from, writing to, journalling or watching the partition with inotify. Also using LVM means that should you get a corrupted file system on your vm, that corruption will not affect other vms or the host partition (because there isn't one).

Word!!!

1 Like

Good stuff guys, thanks. I will buy another drive for VMs.

1 Like

Being able to snapshot a VM is a blessing. I use Virtual Machine Manager myself have rolled back a several VM's with no problems. Also cloning is very nice having a default install of windows for instance and cloning it to mess around with then delete is nice.

3 Likes

Absolutely essential, new Windows VM in minutes instead of 2 hours. Also you can update and sysprep on a regular basis and have all essential software pre-installed

1 Like