Re-connecting to a VM with VNC stops the VM

Dsc

Cadet
Joined
Sep 24, 2020
Messages
1
Hi -

I've setup up my first FreeNAS server and so far so good bar one issue I keep running into and haven't been able to resolve.

I'm running FreeNAS11.3-U4.1 on:
  • Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz 4 core
  • 16Gb DDR4 RAM
  • ASROCK B365M PRO4 Motherboard
  • 3 x 2Tb WD Red disk
I've setup a Ubuntu 20.04 Desktop virtual machine with 2 CPU & 2Gb RAM.

When I start up the VM I am able to connect to it using the noVNC straight from the VNC link in FreeNAS. I upped the resolution to 1920x1200 and have been able to access the VM just fine adding and running some software - so far so good. I made no other changes to default VNC settings.

The problem happens if I walk away for a random period of time - a few hours or more indeterminate and I am no longer able to VNC to the VM. The VM then stops.
If I restart it then it works all again just fine - until the next time.

I've tried disconnecting the VNC session first before closing the browser - and that makes no difference, nor does increasing/decreasing the CPU/RAM dedicated to the VM.

I *think* this sounds a bit like this issue in this thread here but I am not sure what the resolution is - I really do need to be able to VNC to the VM as I use it for some apps I run there.

I've looked in the logfiles for the VM and this is what I have when I reconnect (not sure why the same lines are repeated 3 times):

Code:
[2020-09-26 08:30:20,905] (DEBUG) VMService.vm_7.run():315 - Ubuntu: 26/09/2020 08:30:20   other clients:
[2020-09-26 08:30:20,905] (DEBUG) VMService.vm_7.run():315 - Ubuntu: 26/09/2020 08:30:20   other clients:
[2020-09-26 08:30:20,905] (DEBUG) VMService.vm_7.run():315 - Ubuntu: 26/09/2020 08:30:20   other clients:
[2020-09-26 08:30:21,230] (INFO) VMService.vm_7.run():346 - ===> Error VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,230] (INFO) VMService.vm_7.run():346 - ===> Error VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,230] (INFO) VMService.vm_7.run():346 - ===> Error VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,242] (ERROR) VMService.vm_7.running():490 - ===> VMM Ubuntu is running without bhyve process.
[2020-09-26 08:30:21,242] (ERROR) VMService.vm_7.running():490 - ===> VMM Ubuntu is running without bhyve process.
[2020-09-26 08:30:21,242] (ERROR) VMService.vm_7.running():490 - ===> VMM Ubuntu is running without bhyve process.
[2020-09-26 08:30:21,245] (DEBUG) VMService.vm_7.__teardown_guest_vmemory():376 - ===> Give back guest memory to ARC: 15235624960
[2020-09-26 08:30:21,245] (DEBUG) VMService.vm_7.__teardown_guest_vmemory():376 - ===> Give back guest memory to ARC: 15235624960
[2020-09-26 08:30:21,245] (DEBUG) VMService.vm_7.__teardown_guest_vmemory():376 - ===> Give back guest memory to ARC: 15235624960
[2020-09-26 08:30:21,246] (WARNING) VMService.vm_7.destroy_vm():353 - ===> Destroying VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,246] (WARNING) VMService.vm_7.destroy_vm():353 - ===> Destroying VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,246] (WARNING) VMService.vm_7.destroy_vm():353 - ===> Destroying VM: Ubuntu ID: 7 BHYVE_CODE: -11
[2020-09-26 08:30:21,257] (DEBUG) VMService.vm_7.kill_bhyve_web():458 - ==> Killing WEBVNC: 32559
[2020-09-26 08:30:21,257] (DEBUG) VMService.vm_7.kill_bhyve_web():458 - ==> Killing WEBVNC: 32559


I'm really hoping someone can give me a steer and possibly answer some of these questions I have:
  • This feels like something or other timed out on the VM/FreeNAS - is there any other diagnostic I can check to find out?
  • Is there a different type of VNC server I should use on the VM to bypass this issue?
  • I've tried this with Fedora and got similar issues; any other distro I should possibly look at?
  • Is this a known bug?

Many thanks in advance for you time - any guidance appreciated; I'm new to FreeNAS and newish to Linux - so if there's other information I need to extract please be explicit how to find it.

Regards
 

SimonTh

Cadet
Joined
Mar 17, 2019
Messages
3
Hey, just wanted to say I see the same problem. When I try to reconnect to the VNC it fails and the VM is stopped. The guest OS dosen't seem to matter. I think it's a bug. Sorry I can't be of any more help...
 

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
I've seen the same behaviour. A few months back there was a thread with a few people discussing, and no one could ever *prove* that VNC access causes the VM to eventually die (due to the random nature of the timing), but that seemed to be the common pattern.

My solution was to just stop using VNC. Now I use RDP or SSH. It's a pretty half-assed solution, but it solved the problem and my VMs don't die anymore.

All of my VMs are Ubuntu.
 

JavaScriptDude

Dabbler
Joined
Nov 5, 2011
Messages
22
I'm setting up Windows Server 2016 at the moment in a VM and just saw this several times. I was using RDP but did have VNC still enabled. Not sure at what point the crash occurred but the RDP stopped working first and I could not ping the VM any longer.

I've now deleted VNC device and am going to try again to see if that does the trick.
 

JavaScriptDude

Dabbler
Joined
Nov 5, 2011
Messages
22
Just happened again but VM is still alive according to Web GUI but I cannot access by RDP or ping it.

I cannot figure out how to inspect VM from command line though. I tried vm list but got $vm_enable is not enabled in /etc/rc.conf . If there is a doc or procedure explaining how to safely enable that, please let me know.

For now, I will try to re-enable VNC to see if that crashes the VM. I will tail the VM log to watch in real time to confirm...
 

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
After struggling with this behaviour for a year, I finally found a solution!

My VM is Ubuntu. I tried building a new VM from the Ubuntu install disk and building a clean machine... same problem with freezing.

I noticed that one of my VMs chronically froze while the other didn't. Amongst other things, the kernel version was different between the two. Kernel v5.8.4 would experience the freeze-ups. Kernel v5.4.0 didn't.

So I cloned the VM that was experiencing freezes, installed Kernel v5.4.0, and it's been running smoothly ever since. No idea where the conflict is or if there's a better work-around out there. But that worked for me.

If I were a better computer nerd then I'd try a newer kernel version to try and nail down exactly where the problem happens. But I don't really care that much. I'm just excited to have it stop freezing.

Server:
FreeNAS-11.3-U3.2

VM:
Ubuntu 20.04.2 LTS
Kernel: Linux 5.4.0-050400-generic
 
Top