Virtual Machines - desktop (and server) advice please?

Some months ago when I first started seriously considering Gnome 3 for daily use, I experimented with Boxes and installed Fedora 30 as a guest on my Debian 10 host. I was absolutely thrilled with how easy this was, how everything “just worked” and also how fast the virtual machine seemed to be compared to what I was used to running VMs under Virtualbox on Windows.

Because it’s obvious that Boxes is fairly restrictive in the controls it allows, I thought I’d try Virtual Machine Manager as an alternative. On trying to install CentOS 8 Stream using Virtual Machine Manager, I found the screen output disappeared as soon as I tried running the CentOS installer. I tried it on Boxes instead. It worked immediately.

What’s been scary about Boxes, though, is it doesn’t seem to have much for importing and exporting VMs, which for me is crucial, so that I can move a machine with all it’s saved work from one host to another easily.

It seems it’s possible to convert Virtualbox images from the command line and import them into Qemu, which is the backend of both Boxes and Virtual Machine Manager, but I thought I’d try installing Virtualbox instead so that I could import previously saved VMs directly.

So… I installed Virtualbox and Extension Pack on Debian 10 host, imported a Ubuntu (18.10, I think) image, found it ran perfectly, though disappointingly very slowly. After the VM had finished updating, I shut it down, tweaked settings in Virtualbox, re-ran and it’s running with very good performance now! So, I thought I’d install a previously saved image of Fedora 31, which I did. That also works fine, performance is okay but still seems slower than expected to me, given how fast it had run for me under Boxes, also I had to mess around a fair bit with it to get the Guest Additions to compile for full-screen to be enabled, which I eventually succeeded with.

A problem I am having with Virtualbox (6.0.14), is that it seems to keep losing mouse capture. So the VM is running but it’s not seeing mouse movements when mouse is clearly in range of the VM window… Obviously this is a deal-breaker and I have no idea why this is happening. It was happening under Virtualbox 6 with Debian Sid guest under Windows 10 host too, so I’m thinking it’s Virtualbox :frowning:

Now I’m wondering if I shouldn’t go back to Qemu, learning it from low-level upwards, to better understand VMs under Virtual Machine Manager and Boxes, in a way that my knowledge is transferable to servers too, eventually.

I’d appreciate advice from seasoned users of Virtualbox who may know how to get around the mouse not being captured problem (on Windows and Debian+Gnome+Wayland) described above.

I’d appreciate advice from seasoned users of Virtual Machine Manager who may know how to get around the problem of why the screen suddenly disappeared when trying to install CentOS 8 Stream.

I’d appreciate advice from seasoned users of Qemu on appropriate documentation / books that I could use to understand it better, because it seems to have more scope in terms of architectures it emulates and (I think) that knowledge could then be extended to use with servers too

Thank :slight_smile:

1 Like

Well at first I thought you were asking which VM host software to use but you’re not, so I’ve retracted my original comment, I was too hasty :smiley:

Whenever I think about not using VirtualBox I find a world of confusion awaits me, virt manager, no wait, that’s just a thing that manages qemu, what’s qemu, oh it’s like KVM but … hang on, where does Xen sit in all of this, and … etc etc. Too much stuff that assumes you know what other stuff is. If KVM is kernel-based isn’t it restricted to running only Linux VMs, for instance… and if so doesn’t that kind of make it a container?

And so it goes on.

BTW I know some of what I just said is wrong but that’s kind of my point.

1 Like

@david.smyth I agree there’s a lot of scope for confusion when it comes to VMs - probably why I’m confused too and stuck to Virtualbox until recently, though I have found Boxes even simpler. I looked further into this too. It seems that Xen is a low-level hypervisor on top of which other OSes can run. Apparently it’s been around for longer than KVM which is a hypervisor built right into the Linux kernel; on Linux Qemu appears to be the user-space part of the virtualisation code that emulates the processor if necessary and runs the OS as a guest on top of this. Apparently KVM and Qemu integrate really well, providing performance benefits compared to Virtualbox on Linux, but that’s how it seems with my little knowledge of the matter. I was interested to see a youtube video of a Qemu VM running on Windows, hence my interest in looking into Qemu and as it happens KVM at a lower level and taking it from there. I’m not sure if Xen is now outmoded or actually still important to know. I also think Qemu is used by Google for their Android Emulator which integrates with AndroidStudio but I found really slow on Windows; havent’ tried it yet relatively modern hardware running Linux.

I look forward to hearing from users who know more about all this!

1 Like

Excellent, I definitely need to look into this more. Thanks for taking the time to explain a bit about them, sounds like it’s worth giving them all a go. I tried Boxes years ago and it was really quick to get up and running but I have a feeling there was something missing that I wanted to do and that’s what sent me back to VirtualBox.

There’s also Proxmox to consider, I’ve heard this mentioned by a lot of people lately and I like that it can manage both KVM virtual machines and LXC containers.

I don’t really need new hardware but not being able to add more storage to my current home server and not having enough memory to really support multiple VMs it’s very tempting to invest in something new to try out this stuff in anger as it were. Must resist.

But then, if the Pinebook Pro works out then I won’t need another laptop and I’ve saved money, no harm in directing that money elsewhere … :thinking:

1 Like

@david.smyth No worries. I think sharing what we learn has the potential for benefitting the community as a whole, so I’m definitely up for that. After I created a VM on Boxes, I managed to get Virtual Machine Manager to run it too, which is nice, and it didn’t break anything to stop Boxes from running it afterwards. Very useful! I’m not sure what LXC containers are. I’ve not really delved into Docker or other container technology, unless Snaps/Flatpak count as that, but they’re point and click installs, so, no confusion there yet for me :slight_smile:

The first time I tried Boxes, recently, it was on a nine-year-old dual-core device. I was shocked because the guest seemed to be running very, very fast for the hardware it was on, despite being virtualised :slight_smile:

I’m just about to post about an Extend podcast I listened to just now. Seems like the mouse issue I was having may be related to Gnome, though I could swear I had a similar problem with Virtualbox on Windows. Will be interesting to see how it fares under XFCE for example!

Update: I just spend a good long while testing the same VM under XFCE, Plasma, Gnome+Wayland and Gnome+X. XFCE and Plasma support the mouse integration better than Gnome does on either Wayland or X. Looks like it’s a combination of Gnome and Virtualbox mouse integration / automatic capture that the VM’s falling foul of on Fedora 31 guest under Debian 10 host, maybe also partly related to Guest Additions for that distro, as Ubuntu (18.10 I think) has no problems with Gnome+Wayland on Virtualbox on same machine :confused:

1 Like

XFCE :heart:

[I wanted to say just that but minimum chars required.]

1 Like

I find XFCE to be excellent and have used it for about six years. On a high-res screen though I’m finding it strains my eyes a fair bit because it’s not easy to scale display, as far as I know. Also using Gnome under Wayland has some security benefits I believe, so that was another reason for my switching.

No idea of this would help but there is a setting under VirtualBox Preference - Input for “capture keyboard automatically”. This is somewhat misnamed as it captures the mouse and keyboard. I tend to uncheck it since I don’t like the behavior of auto capture. What I do it either explicitly click in the VM window or use the right Ctrl key as a toggle for that purpose (which is the default).

2 Likes

@EricAdams, Thanks, I believe this is relevant. Will let you know if I get any specific improvements consequently :slight_smile: I have to say though, after you mentioned about the mouse problem in Gnome, I’m tempted to look a little deeper into this. My longer-term goal is to contribute as a developer so I’m keeping an open mind towards possible projects. XFCE is one, now Gnome might be another.

Update:
I just spent ages trying to get to the bottom of this and have concluded it’s definitely a Virtualbox problem, not a Gnome problem. In case anybody else hits this, here’s what I had to do to get a VM of Debian 10 stable working correctly:

Switch Display controller from VBoxVGA to VMSVGA
(this is because Virtualbox reports support for VBoxVGA will be discontinued from the next version upward and any VMs saved with that option will then stop working, I think)

Install latest version of Guest Additions
(as this seems to have the code for mouse integration)

Switch Pointing Device from USB Tablet to PS/2 Mouse
(I have a touchscreen and I think the drivers for that sometimes don’t work properly, both on Linux and Windows, neither USB Tablet nor USB multi-touch tablet worked properly on my system)

Enable Mouse Integration
(When I tried disabling it and switching manually, it went completely haywire on Debian 10 + Gnome + Wayland, though it may be useful on other systems)

Without all of the above, the mouse pointer was continuously disappearing and I couldn’t get it back without shutting down the VM :frowning:

After writing the above, I experimented a fair bit more with Virtualbox and even decided to buy a book on it as stable VMs are essential for my workflow. Fortunately it turns out the official Virtualbox documentation is free to download and is actually quite helpful. I’m going to post some advice tips on it shortly…!

I honestly had so many problems with Gnome 3 that I was not sure if it was the cause of various issues or not. Move to Cinnamon, which got rid of all problems for me. Xfce was also good, but not quite as polished.

1 Like

@samsonite Thanks for your feedback. I did wonder about that, though unfortunately Virtualbox is having the same problem for me under XFCE and KDE too on the same hardware and OS installation :frowning:

Further update on my experiments with VMs on Virtualbox running on Debian Stable host with Debian Stable guest (mainly for purposes of building LFS):

The following give me best results:

Switch Display controller from VBoxVGA to VMSVGA
(this is because Virtualbox reports support for VBoxVGA will be discontinued from the next version upward and any VMs saved with that option will then stop working, I think)

Install latest version of Guest Additions
(as this seems to have the code for mouse integration)

Switch Pointing Device from USB Tablet to PS/2 Mouse
(I have a touchscreen and I think the drivers for that sometimes don’t work properly, both on Linux and Windows, neither USB Tablet nor USB multi-touch tablet worked properly on my system)

Enable Mouse Integration
(When I tried disabling it and switching manually, it went completely haywire on Debian 10 + Gnome + Wayland, though it may be useful on other systems)

Disable 3D Acceleration
(I do believe this is an experimental feature and I’m having more success with it disabled.)

Run the guest in a maximised Virtualbox window on the host. Do not run the guest in full-screen mode
(this reduces chance of erratic mouse behaviour because the pointer won’t be moving between host and guest windows constantly. When I switch the guest to full-screen mode that’s not in a Virtualbox window on the host, I often end-up losing the mouse completely in the guest, then the mouse might not work properly on other applications on the host DE either, until the VM is closed.)

Disable Shared clipboard and Disable Drag’n’drop
(Many people on the web have previously reported this helps reduce erratic mouse behaviour and it certainly helps me, though it would be useful if it worked.)

1 Like