Jump to content
Sign in to follow this  
Jamntoast

Windows 10 vm is shutting down in container after a few hours

16 posts in this topic Last Reply

Recommended Posts

Posted (edited)

I'm not sure how to keep this vm running without shutting down, the vm doesn't stop but rather the windows 10 machine inside is given a shutdown command and I need some help to understand why. 

From the unraid dashboard and in the apps list I click on the vm and then show log, 

this is what it spits out, let me know if there is any more info I can provide, and thanks so much for any help in advance! 

 

I grabbed a couple parts from two instances of the vm starting up and then shutdown.  I also added the xml of the vm at the bottom. 


 

2019-08-07 23:13:26.318+0000: starting up libvirt version: 4.7.0, qemu version: 3.0.0, kernel: 4.18.20-unRAID, hostname: NASP
LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/local/sbin/qemu -name guest=W10Server,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-W10Server/master-key.aes -machine pc-i440fx-3.0,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off -cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=none -drive file=/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/etc/libvirt/qemu/nvram/7d86d62d-2bc3-936c-fb52-39cbf1ca757d_VARS-pure-efi.fd,if=pflash,format=raw,unit=1 -m 8192 -realtime mlock=off -smp 6,sockets=1,cores=6,threads=1 -uuid 7d86d62d-2bc3-936c-fb52-39cbf1ca757d -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=24,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-hpet -no-shutdown -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x7.0x7 -device ich9-usb-uhci1,masterbus=usb.0,fial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=30,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:0,websocket=5700 -k en-us -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
2019-08-07 23:13:26.318+0000: Domain id=1 is tainted: high-privileges
2019-08-07 23:13:26.318+0000: Domain id=1 is tainted: host-cpu
2019-08-07T23:13:26.363427Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0)
2019-08-07T23:13:43.618505Z qemu-system-x86_64: warning: guest updated active QH
2019-08-08T18:16:34.237495Z qemu-system-x86_64: terminating on signal 15 from pid 28045 (/usr/sbin/libvirtd)
2019-08-08 18:16:34.474+0000: shutting down, reason=shutdown


2019-08-08 18:17:23.653+0000: starting up libvirt version: 4.7.0, qemu version: 3.0.0, kernel: 4.18.20-unRAID, hostname: NASP
LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/local/sbin/qemu -name guest=W10Server,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-W10Server/master-key.aes -machine pc-i440fx-3.0,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off -cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=none -drive file=/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/etc/libvirt/qemu/nvram/7d86d62d-2bc3-936c-fb52-39cbf1ca757d_VARS-pure-efi.fd,if=pflash,format=raw,unit=1 -m 8192 -realtime mlock=off -smp 6,sockets=1,cores=6,threads=1 -uuid 7d86d62d-2bc3-936c-fb52-39cbf1ca757d -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=26,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-hpet -no-shutdown -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x7.0x7 -device ich9-usb-uhci1,masterbus=usb.0,fial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=31,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:0,websocket=5700 -k en-us -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
2019-08-08 18:17:23.653+0000: Domain id=1 is tainted: high-privileges
2019-08-08 18:17:23.654+0000: Domain id=1 is tainted: host-cpu
2019-08-08T18:17:23.704550Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0)
2019-08-10T13:37:42.853403Z qemu-system-x86_64: terminating on signal 15 from pid 9317 (/usr/sbin/libvirtd)
2019-08-10 13:37:43.088+0000: shutting down, reason=shutdown

 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' id='1'>
  <name>W10Server</name>
  <uuid>7d86d62d-2bc3-936c-fb52-39cbf1ca757d</uuid>
  <description>Windows 10 x64 VM Server</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
    <vcpupin vcpu='2' cpuset='4'/>
    <vcpupin vcpu='3' cpuset='5'/>
    <vcpupin vcpu='4' cpuset='6'/>
    <vcpupin vcpu='5' cpuset='7'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-3.0'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/7d86d62d-2bc3-936c-fb52-39cbf1ca757d_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='6' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Windows10x64.iso'/>
      <backingStore/>
      <target dev='hda' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.141.iso'/>
      <backingStore/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:72:59:9b'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-W10Server/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>


 

Edited by Jamntoast
fixed code box

Share this post


Link to post

Do you have any user scripts running maybe, for example a backup script that shuts down your VMs?

Share this post


Link to post

Next time the VM shuts itself down:

  • Tools -> Diagnostics -> Download -> attach zip file here
  • From your VM log, look for the most recent line that looks like this: "terminating on signal 15 from pid [a pid number]", go to Tools -> Processes and look for the pid number and copy-paste that line here. If you can't find it report you can't find it + pid number.
  • On the Main tab, take a screenshot of your array and cache (and any Unassigned Devices) showing how much free space is available on all disks

Also, for text that you copy-paste from Unraid to the forum, please use the Code button on the forum (it's the button that looks like </>). It makes it easier to look at things.

 

Expectation management: there are many things that can cause VM to shut itself down so keep your fingers crossed that there's an obvious cause.

Share this post


Link to post
Posted (edited)

Just an idea. Back when I played around with Server2008R2 a non activated install first informed the user to activate the install and after a certain amount of days it shuts itself down after a couple hours of use. The VM logs showed the VM is shutdown and not paused by a full cache disk or a disk the vdisk sits on. Just an idea.

 

Edit:

Don't know if that only depends on specific server versions or if something changed until today. I've last played around with Windows server versions, 2-3 years ago.

Edited by bastl

Share this post


Link to post

I attached the diags and a screenshot of array, I have the domains, appdata and system all set to cache only.

The vm restarted again but it didn't give me the same readout on the vm log so I was unable to see it in the processes, I'll keep an eye out for the next time.

array.png

nasp-diagnostics-20190812-0121.zip

Share this post


Link to post
17 hours ago, bastl said:

Do you have any user scripts running maybe, for example a backup script that shuts down your VMs?

I don't have anything running like that, I have a few community apps installed,

apps.png

Share this post


Link to post

It might be worth checking the settings for CA Appdata Backup/Restore to see what schedule you have set for that.   I thought it only shutdown docker containers while doing its backup but maybe it can affect VMs as well.

Share this post


Link to post

I recently upgraded unraid from 6.6.6 to 6.7.2 after my first post thinking it may help.

unfortunately I'm not seeing the shutdown in the vm log now.

-m 8192 \
-realtime mlock=off \
-smp 6,sockets=1,cores=6,threads=1 \
-uuid 7d86d62d-2bc3-936c-fb52-39cbf1ca757d \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=27,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=localtime \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x7.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x7 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x7.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x7.0x2 \
-device ahci,id=sata0,bus=pci.0,addr=0x4 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 \
-drive 'file=/mnt/user/domains/Windows 10/vdisk1.img,format=raw,if=none,id=drive-virtio-disk2,cache=writeback' \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk2,id=virtio-disk2,bootindex=1,write-cache=on \
-drive file=/mnt/user/isos/Windows10x64.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on \
-device ide-cd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=2 \
-drive file=/mnt/user/isos/virtio-win-0.1.141.iso,format=raw,if=none,id=drive-sata0-0-1,readonly=on \
-device ide-cd,bus=sata0.1,drive=drive-sata0-0-1,id=sata0-0-1 \
-netdev tap,fd=29,id=hostnet0,vhost=on,vhostfd=30 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:72:59:9b,bus=pci.0,addr=0x3 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=31,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-vnc 0.0.0.0:0,websocket=5700 \
-k en-us \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
2019-08-12 01:25:25.109+0000: Domain id=2 is tainted: high-privileges
2019-08-12 01:25:25.109+0000: Domain id=2 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

 

Share this post


Link to post
Posted (edited)
5 hours ago, itimpi said:

It might be worth checking the settings for CA Appdata Backup/Restore to see what schedule you have set for that.   I thought it only shutdown docker containers while doing its backup but maybe it can affect VMs as well.

I don't have it running on a schedule.

I'd just rebuild the vm at this point but it has a W10 key I paid for on it and I'm not sure how that would work with the hardware profile and activation. The last time I had used it to install the vm I had to call into M$ to get it working, I'm afraid to get it blacklisted to keep reinstalling.

 

The only schedule I know of is parity check every Tuesday at midnight and move daily at 11am.

Edited by Jamntoast

Share this post


Link to post

I also have a new problem with the vm since upgrading unraid, when the vm is without vnc or rdp connection one of the cores is at 100%, if I log in with rdp or vnc remote it idles back down.

 

Annotation 2019-08-13 121554.png

Share this post


Link to post

If you are running the latest build of Windows then this is a known problem with Windows and RDP and is not Unraid specific.   Until Microsoft fix this there is a workaround available by disabling the new WDM driver within Windows.   I do not have a URL to hand but it should be easy enough to find using Google.

Share this post


Link to post
On 8/11/2019 at 6:09 AM, bastl said:

Just an idea. Back when I played around with Server2008R2 a non activated install first informed the user to activate the install and after a certain amount of days it shuts itself down after a couple hours of use. The VM logs showed the VM is shutdown and not paused by a full cache disk or a disk the vdisk sits on. Just an idea.

 

Edit:

Don't know if that only depends on specific server versions or if something changed until today. I've last played around with Windows server versions, 2-3 years ago.

Have you turned off sleep / hibernation in the VM

Share this post


Link to post
Posted (edited)
2 hours ago, itimpi said:

If you are running the latest build of Windows then this is a known problem with Windows and RDP and is not Unraid specific.   Until Microsoft fix this there is a workaround available by disabling the new WDM driver within Windows.   I do not have a URL to hand but it should be easy enough to find using Google.

Yes, that's what this appears to be, I did update windows and it did the 1903 feature update. I rolled back unraid to 6.6.6 and same problem with the core maxed at 100%. Thanks for reply, I'll look into disabling wdm. 

 

I was able to correct the 100% core issue with disabling the wdm driver. Thanks for the link johnnie.black! 

 

Ok, so back down to the original issue, I'm still keeping an eye out for the next time it shuts down to grab the log. 

Edited by Jamntoast

Share this post


Link to post
1 hour ago, Squid said:

Have you turned off sleep / hibernation in the VM

I have disabled them yes, but maybe I need to do it through cmd instead of the power profile. I'll try that as well. 

 

Share this post


Link to post

Well Just an update, it seems to have sorted itself out, been running for a couple days with no interruption. Not really sure what to pin it on but here's what my system has gone through, upgraded unraid from 6.6.6 to 6.7.2 , problem still seemed persistent after that. Windows feature update on vm to build 1903 and I disabled WDM driver in group policy as I was getting the max core error when vm was idle.

 

I just want to say thanks to everyone who contributed and helped out on troubleshooting this issue and bringing to my attention the fix for WDM driver issue. I had been googling for that error but didn't see that fix in results.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this