VM dropped suddenly in performance.

Discussions about using Linux guests in VirtualBox.
Post Reply
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

VM dropped suddenly in performance.

Post by AstroMix »

Host: Windows 10 Home
Guest: Ubuntu 18.04 -GNC (64-bit)
CPU: Intel(R) Core(TM) i7-4810MQ CPU @2.80Ghz
Processor Numbers used by VM: 4
RAM: 16GB (VM: 8863 MB)
Video Memory: 128 MB
Graphics Controller: VMSVGA
Acceleration: 3D
GPUs: Nvidia GeForce GTX 980M & Intel(R) HD Graphics 4600

Recently my Ubuntu guest suffered a sudden drop in performance. Running Gazebo 9 with ROS Melodic with a single UAV would provide approx. 40 fps with nothing happening. Now I am lucky to get above 1 fps. This prevents me carrying out more complex simulations that is required. I have no idea why this has occurred. I have done the following things in attempt to fix the problem:
1. Update VirtualBox to latest version, before it was the one pervious to it.
2. Go into Graphics setting and set "VirtualBox Manager" & "VirtualBox Virtual Machine" to High Performance.
3. Go into NVIDIA Control Panel to set "virtualbox.exe" and "virtualboxvm.exe" to High Performance.
It should also be noted that when running Ubuntu VM NVIDIA GPU Activity says "There are no applications running on this GPU"
4. Increased RAM to the current amount by adding 2GB worth of RAM, (note, it was discovered when running Gazebo approx. only 2GB were used anyways so it was a useless move)
5. Doubling the amount of processors provided to the VM. (still within the green limits but on the border)

I am kind of new to Virtual Machines and advice on getting the machine back to its old performance would be much appreciated!
Thank you.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM dropped suddenly in performance.

Post by scottgus1 »

Please right-click the guest in the main Virtualbox window's guest list, choose Show Log.

Search the far left tab's log for this text:

Attempting fall back to NEM

If you find it, Hyper-V is enabled. See HMR3Init: Attempting fall back to NEM (Hyper-V is active).

If you don't find that text, save the far left tab's log, zip the log file, and post the zip file, using the forum's Upload Attachment tab.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Thank you for coming back to me.
I could not find "Attempting fall back to NEM" in the log, so I've attached the log as requested.
Attachments
ubuntu18-GNC-2021-03-12-23-13-15.zip
(33.82 KiB) Downloaded 11 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM dropped suddenly in performance.

Post by scottgus1 »

You don't have Hyper-V running, that's good. However, aside from having all four hyperthreaded physical cores set for the VM to use (which could be done but might also slog the host down, too) I don't see anything wrong in the log. Either the problem is in the VM's OS or I have missed the tell-tale log entry. We'll need a forum guru to look into this.

Alternative idea, make a new VM, same setup, fresh install of all VM programs, see if its performance would be any different.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM dropped suddenly in performance.

Post by mpack »

There is also the question of what drive E: is.

Also I see that 3D acceleration is enabled and 128MB graphics RAM allocated... but no sign that the Guest Additions were ever installed. All I see is the GAs ISO still in the virtual CD drive.

Extension pack also not installed. OK if you don't need USB.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Thank you for your replies!
I have 2 SSDs in my laptop. The one VirtualBox is stored in is the C: drive, the E: is the location where I have the Linux VM is stored as it is a much bigger drive. There is also an external hard drive where I keep the shared folder. The shared folder stopped working for some reason but I still keep the external HDD plugged in. A shared folder from the E: drive didn't work either. This isn't much of a problem, I've been using google drive as a work around.

I followed this video a month ago for the installation: https://www.youtube.com/watch?v=sB_5fqiysi4
I see the guest additions in the virtual CD port also! I cant remember ever putting that there. Do you think I accidentally unloaded the guest additions or something silly like that?
I cant see that it is unloaded on the VM? Maybe I'm looking at the VM wrong, but I am getting the option to "Remove disk from virtual drive".
I just check the file and get the error "unable to access "VBox_GAs_6.1.18" Error Mounting /dev/sr0 at /media/[myname]/VBox_GAs_6.1.18: unknown filesystem type 'iso9660' " Is this bad or are GAs just a file you cannot look into?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM dropped suddenly in performance.

Post by mpack »

AstroMix wrote:Do you think I accidentally unloaded the guest additions or something silly like that?
No, the more likely error is quite common. You used Devices|Insert guest additions CD... and you assumed that that installed the Guest Additions. It doesn't, it just inserts the CD like the wording says. On some guests the installer will auto-launch when the CD is inserted, but most OS's these days disable that for security reasons, hence you have to launch the installer yourself.

It is common for Linux guests to give you errors when you insert or remove a CD, because you're technically supposed to unmount the filesystem before removing the disk. The VirtualBox "remove CD" dialog offers a force unmount option, which you should use.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Ah I see, I'll give this a go. Is there a guide for something like this?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM dropped suddenly in performance.

Post by mpack »

The user manual (chapter 4) should be a good place to start. There's a PDF in your VirtualBox program folder, there's also an F1 help version and an online version.

The main thing with Linux guests is: be sure to install the prerequisities first. A Linux GAs install involves compiling from sources, so you need to first download the headers for your kernel, and the gcc compiler package. If your Linux disables running .sh scripts directly off the CD in GUI mode then open a terminal window and run bash from the command line.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Thinking back I did do some sort of magical miss click when trying to sort out the shared folder problem from before hitting the "insert Guest Additions CD image"... Just thought nothing of it.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Thank you for the continual support.
So I checked the kernel in terminal with "uname -r" and got "5.4.0-66-generic".
The GCC Version was checked with "gcc --version" and got "gcc (ubuntu 7.5.0-3ubuntu~18.04)7.50"
With kernel headers with "apt search linux-headers-$(uname -r)" I, got " bionic security 5.4.0-66.74~18.04.02 i386 linux kernal headers for version 5.4.0 on 32bit x86 SMP"
I assume all these are correct and up to date
I then force unmounted the CD drive after getting the (VERR_PDM_MEDIA_LOCKED) error.
Reinserted the CD drive as per 4.2.2.1(2).

Ran "sudo -s" in terminal to get the root
Changed the directory to "cd /media/"
Ran "sh ./VBoxLinuxAdditions.run" as per 4.2.2.1(3) and got the error "sh: 0: Cannot open ./VBoxLinuxAdditions.run"

What am I doing wrong?
Thank you for the support.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM dropped suddenly in performance.

Post by mpack »

I'm going to move this topic to the "Linux Guests" forum, since very little of the recent discussion seems to concern your Windows Host.
AstroMix
Posts: 7
Joined: 13. Mar 2021, 01:09

Re: VM dropped suddenly in performance.

Post by AstroMix »

Okay so randomly today the CD for the Guest Additions randomly decided to show today. So I installed the Guest additions using this tutorial: https://www.youtube.com/watch?v=V4tGpsZiOdw and got the result in the terminal. Is there anything I can do to make sure this never happens again?
Also it seems to have changed my resolution to default? At least something smaller than it was before I restarted like it told me to. Silly question but is it safe to change it back to how it used to be?
Attachments
Capture.PNG
Capture.PNG (88.52 KiB) Viewed 4111 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM dropped suddenly in performance.

Post by scottgus1 »

From this it appears that you need to reboot the VM. That also is required after installing GAs on Windows VMs.
Post Reply