Virtualbox seems slower compared to virt manager

Hi,
I need to get ros installed on my machine, so I virtualized Ubuntu on oracle’s virtualbox
installed the extension pack and guest additions, but still the performance is nowhere near virt manager in my case.
How can I find the issue, I am using virtualbox because I need 3d acceleration, which I couldn’t set up with virt manager.

On Fri, 03 May 2019 19:26:03 +0000, K380 wrote:

> Hi,
> I need to get ros installed on my machine, so I virtualized Ubuntu on
> oracle’s virtualbox installed the extension pack and guest additions,
> but still the performance is nowhere near virt manager in my case.
> How can I find the issue, I am using virtualbox because I need 3d
> acceleration, which I couldn’t set up with virt manager.

“slower” is a fairly vague term and could relate to a number of things
(network performance, vcpu performance, etc). Can you be more specific
about what’s not working as you expect - what you’re seeing and what your
expectation is?

Also, information about how the VM is configured - how much memory, how
many vcpus, etc - would also be helpful for someone trying to help narrow
it down.


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

By slower I meant that the programs open a lot slower compared to virt manager, firefox takes 10 secs vs 3 secs and even terminal takes 3 secs to load
Boot is much slower, lags in opening menus etc… (both have identical configurations (as far as basic cpus memory etc go))

Also, information about how the VM is configured - how much memory, how
many vcpus, etc - would also be helpful for someone trying to help narrow
it down.

Host specs (laptop):
i5 7200u 7th gen
16 GB Ram
2 GB amd graphics
HDD + SSD

Guest configuration:
4 GB ram
2 cpus
Vt-x/AMD-v enabled
Video memory 128 MB
3d acceleration enabled

I’m using hdd for installation of the vm as I don’t have much free on the ssd. And when I compared performance both were installed on hdd.

If you have 3d acceleration enabled, have you bumped up your virtual VRAM to at least 39MB (more if you need it)?
If your VRAM is still at default setup settings, a warning should display in tiny lettering at the bottom of some windows, but it’s easy to overlook.

Worth Some reading because a lot of things have changed with latest versions…

Guest Additions
https://www.virtualbox.org/manual/ch04.html

Misc Advanced Topics
https://www.virtualbox.org/manual/ch09.html

Troubleshooting
https://www.virtualbox.org/manual/ch12.html

TSU

Earlier vram was 128MB I bumped it to 256MB, (max possible)
Set the ram to 8 GB from 4GB
There does not seem much of a difference

I tried disabling intel c states as described in the virtualbox faq, still no difference but the laptop runs a lot hotter now.

I think there is currently some difference between virt manager and virtualbox, which makes the latter a bit slower.
I’ll have to live with that given I get some 3d acceleration with no effort by using virtualbox.

Recently, I’ve experimented with suing 2 CPU v cores instead of my usual one… and gotten very noticeable better response.

TSU

I’m already using 2 cores, max is 4 but cannot set to that as it is not recommended by virtualbox.

You say compared to virt manager but do not say what VM you are using? KVM, Xen Something else? In any case the class of VM managed by Virt manager is not he same as the class of VM used by VirtualBox.

https://searchservervirtualization.techtarget.com/feature/Whats-the-difference-between-Type-1-and-Type-2-hypervisors

VirtualBox is a type 2 the VMs managed by Virt is type 1

I would not expect the same performance

The article you quote is saying something I’ve never heard before, and sounds ridiculous. Installing “on physical hardware” is not a differentiator, the truth is that what he believes is “physical hardware” is a nothing burger. The difference between VMware ESXi and ESX is the stripped down to bare essentials nature of ESXi vs “all the User Mode bells and whistles” of ESX and the same can be more or less accomplished for any other virtualization, eg Install KVM or Xen hypervisors with no User Tools and minimal server configuration, administer remotely and you have something comparable to ESXi (or MS Hypervisor Server). The hypervisor architecture is no different whether you are running on a bare hypervisor or a fully featured server with hypervisor.
His definition of the difference between a Type 1 and Type 2 hypervisor is superficial and is likely not defined as he describes by anyone else (I wonder where he got his ideas from).

Indeed, there is/has been a Type 1 hypervisor, but Xen is the only virtualization which is considered of that type.
Every other known hypervisor in existence is a Type 2 hypervisor, and one of the features of this is that whatever you learn using any of these hypervisors can be applied to any other… usually even using the same nomenclature.

When you read the description of a Type 1 hypervisor, an important architectural feature is the Dom0 vs all the other DomU
The following is a link to the current Xen Project which describes basics. Take special note of the first illustration that describes Xen architecture.

https://wiki.xen.org/wiki/Xen_Project_Software_Overview

A type 2 hypervisor looks nothing like Xen, you won’t see a Dom0. Your guests run on top of the hypervisor similar to the Type 1 DomU, but management is deployed as User Mode tools, not in its own Dom.

Another important differentiation in the past was that a Xen kernel was completely differently than Type 2 virtualization kernel modules, but that is no longer the case, Xen is also now fully integrated into the Linux kernel and deployed as kernel modules.

TSU

Regarding performance,
It’s important to understand when comparing virtualization technologies that because of Hardware assist (ie Intel and AMD CPU virtualization extensions) it’s unlikely that you’ll find anything that’s related to CPU or RAM functionality aside from various configuration options like allocated amounts, shared pages, ballooning, etc.

The most likely places you’ll find differences are related to I/O because today it’s not virtualized and there aren’t many standards (aside from IOMMU),
There will be settings for disk access and block/partition alignment but the latter only applies if you copy virtual machines from one Host to another, and might involve a Windows file system and Linux file systems.
Device I/O can vary greatly, some virtualization are better, others not.

Keep in mind that many Virtualbox features are “experimental” and have been for years because maintainers don’t yet want to guarantee their work. I’ve found some things like 2D/3D and nested paging either don’t work well or at all in the past, but from the 6.0 documentation appear to maybe be substantially improved.

All you can do is read what documentation you have, try some tweaking with careful design, and likely go to the VBox Forums and ask questions directly to the VBox maintainers.

TSU

BTW -
You can implement 3D acceleration in KVM and Xen, it’s just not a simple “click the box”

The following describes a starting point to what is possible (don’t know what virtualization you’re actually running, libvirt is only a management option, not the actual virtualization technology)

https://wiki.archlinux.org/index.php/QEMU/Guest_graphics_acceleration

I haven’t tried Looking Glass but I notice it’s in the openSUSE software package search.
https://software.opensuse.org/package/looking-glass-client

QXL is an option which has been around for awhile, GPU pass-through is getting easier (Looking Glass is one method) but still on the bleeding edge.

TSU

I noticed a slight inaccuracy in what I wrote here…
When I said "I/O is not virtualized, I should have said that how I/O is handled is uneven, and you can’t always expect virtualized drivers. Progress has been slow, some I/O has been virtualized, some virtualized drivers have been replaced and improved, and some I/O is not virtualized at all which can suggest some options and improvement. Read the documentation for your particular virtualization for guidance how best to optimize.

And, this can generally be said for all virtualization technologies today.

TSU