Virtualization in Linux - part 2

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,793
Reaction score
3,637
Credits
33,944
This thread is mostly about installing and using VirtualBox. But before we begin, I recommend reading post #1 in this thread.


Almost everything in the post applies to VirtualBox as well. You can skip posts #2 and #3 in that thread if you're going to use VirtualBox.

So how do you install it?

Fedora/Redhat/Rocky/Alma/Oracle
Code:
 dnf install -y VirtualBox-kmodsrc VirtualBox-server akmod-VirtualBox kmod-VirtualBox virtualbox-guest-additions VirtualBox libvirt-daemon-driver-vbox libvirt-daemon-vbox

Mint/Ubuntu/Debian
Code:
sudo apt update<br>sudo apt install -y virtualbox virtualbox-ext-pack virtualbox-guest-additions-iso libvirt-daemon-system libvirt-clients

NOTE: You will need to restart after installing these.
 


When you first bring VirtualBox up, you may see something like this. Ha, you thought you were done installing stuff.
Not quite yet.
Screenshot_20250225_035251.png

Go to

and download the "VirtualBox Extension Pack". The version should match the version of VirtualBox installed on your computer.
NOTE: For some reason this causes some confusion. The VirtualBox Guest Additions are NOT the same things as the VirtualBox Extension Pack. Make sure you download the right one. Usually you don't need the Guest Additions, they should have gotten installed in the previous post above. You usually only need the Extension Pack. It would be nice if Oracle would let vendors have this in their repos, but alas, such is not the case. Most distro (I won't say "all") have the guest additions available in their repos.

Screenshot_20250225_040216.png


Click on the extension Pack link.

Screenshot_20250225_040250.png

Go ahead and download the Extension Pack. Usually this will go into your Downloads directory.

Screenshot_20250225_035549.png


Now back in VirtualBox, click on the Tools Menu on the left side, and then select Extension.

Screenshot_20250225_040501.png

Navigate to your Downloads directory, or wherever you downloaded the Extension to, you should see the Extension Pack in the list here. Go ahead and click on [Open] at the bottom.

Screenshot_20250225_040526.png

You will probably get a warning about how this might blow up your computer. If you're the trusting kind, go ahead and click on [Install]

Screenshot_20250225_040550.png

Next, we get the always fun reading, VirtualBox License agreement from Oracle. Notice the [I Agree] and [I Disagree] buttons are greyed out here. It forces you to scroll to the bottom of the license agreement.


Screenshot_20250225_040719.png

Once you've done all that, you should see the extension pack listed under your tools menu. Great, now we are finally ready to start creating a VM. I am assuming you already have an installer iso downloaded to your home directory. If not, go ahead and download one now, You'll need it before the next steps.


Screenshot_20250225_041054.png


Click on the "Machine" tab, and then click on "New".

Screenshot_20250225_041414.png

You will need to fill in a few things here. Type in the name of the VM you want to use This can be anything that makes sense to you. Usually the "Folder" section will already be populated with your home directory. Then click on the little down arrow at the far right of where it says "ISO Image". Navigate to wherever your installer iso is, and select it. Click on [Next].

Screenshot_20250225_041526.png

Now you need to set how much RAM, and how many CPUs you want to allocate to this VM. Also, this is where you enable EFI for your VM if you want to. I'm not sure why it says (special OSes only) most Linux Linux distros support it, but some do not.

Screenshot_20250225_041609.png

Next you need to set a hard drive size. By default it selects 8GB. That is usually too small in my experience. I would recommend 20GB or larger if you have space.
NOTE: It says I have 2TB of disk available. That is not actually true. This is a 512GB drive in that computer. What this means is I can create 2TB of sparse drives. My 20GB drive won't actually take up 20GB. It gets larger as you install more stuff. You can select "Pre-allocate Full Size", and then it will really use 20GB of disk space. ( or whatever size you create ). Click on [Next].

Screenshot_20250225_041650.png

Now you get a summary screen, showing your configuration of the VM. If everything looks good. Go ahead and click on [Finish].

Screenshot_20250225_041715.png

Now you will see your new VM on the left side. You can either double click on it to start it, or click on the big green arrow that says "Start".

Screenshot_20250225_043301.png

A new console will pop up, and you will see the boot menu of your new VM.

Screenshot_20250225_043646.png

This really isn't a tutorial of how to install Linux, we have plenty of those in other places. But now you be far enough along to know what to do the rest of the way. Just install it as your would normally.

That's it for this tutorial. Happy Linux'ing!
 
Last edited:
I am planning on doing a more advanced options for both Qemu/KVM and VirtualBox at some point in the future, if someone else doesn't beat me to it.
 
How to fix the dreaded VMX root mode error on Intel CPUs. This sometimes happens when trying to run VirtualBox, you will see the following error.

VirtualBox can't operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot.

You probably don't want to recompile your kernel, is there another option?

Code:
echo "install kvm_intel /bin/true" | sudo tee -a /etc/modprobe.d/blacklist.conf
echo "install kvm /bin/true" | sudo tee -a /etc/modprobe.d/blacklist.conf

That will usually fix it.
 
For a future article, should you be so inclined, you can use a few VMWare products for free.
 
you can use a few VMWare products for free.

Least time I used VMware Player it was 30 day trial only. Maybe it's changed?
I think I have a license somewhere.
 
Fusion and Workstation are free for personal use, maybe some other stuff. I think Player was free the last time I used it, but Workstation is adequate, perhaps even more featureful than Player. (I've not used either in a couple of years so I'm not entirely up their SKUs.)
 


Members online


Top