In this post I’ll explain how to setup and install VirtualBox in Linux and how to install an operating system on the virtual machine, using an installation .iso file. Instructions will be given in a step-by-step form, with lots of screen shots. The example is given with Linux (Mint), but the procedure is very similar with Windows.
Needed explanations will mostly be given beneath the pictures.
“Virtual Machine” will be called “VM” in the remainder of this text.
Table Of Contents (T.O.C.):
- Installing VirtualBox
- Configuring VirtualBox
- Creating a new virtual machine
- Configuring the virtual machine
- Appendix – network configuration
- Appendix 2 – Configuring copy/paste between the host and the guest VirtualBox machines
1. Installing VirtualBox
2. Configuring VirtualBox
After the installation, start the VirtualBox. First thing to do after installing is to setup where the virtual machines will be stored. Since this computer has only one (relatively small) SSD, I’ve decided to place the files within the /home/relja/VirtualMachine directory. The procedure is shown in picture 2:
3. Creating a new virtual machine
Clicking “Next” opens new screens with settings:
4. Configuring the virtual machine
Now it is the time to configure the created VM.
Finishing note – boot order can be altered as desired:
5. Appendix – network configuration
Personally I prefer setting up network configuration “manually”, with fixed values (no DHCP with IPv4, nor DHCPv6, or SLAAC with IPv6). When the IP address of the host computer has been set fixed, that setup can also be used with VirtualBox. That is done the following way:
After clicking on “Crate”, a new virtual network adapter will be shown in the list below the options on the screen. Right mouse click on the newly created virtual network card, then choose “Properties”. There you will have the options for setting network parameters.
On the “DHCP Server” tab, it can be configured, or disabled:
6. Appendix 2 – Configuring copy/paste between the host and the guest VirtualBox machines
In this example, we’ll make a Windows 11 (Pro) host machine work with a VirtualBox (version 7.0.2) Linux Mint (Cinnamon) machine so that you can use copy/paste and drag & drop between the host and the “guest” machine. I’ll make this simple, relatively short, step-by-step, so let’s start:
What we need to do is install and configure “VirtualBox Guest Additions” for our Linux guest machine. That’s what it boils down to.
Start the virtual machine and go to the settings options:
Next, we’ll configure the shared clipboard options and mount the “VirtualBox Guest Additions” iso file for our Linux guest machine:
The file is in the VirtualBox’s directory – in my case, that’s:
Now we need to open the
command prompt terminal (CTRL+ALT+T), and run the following two commands:
sudo apt update sudo apt install build-essential dkms linux-headers-$(uname -r)
After that, go to the mounted iso file, which now acts as a “CD drive.” In my case, the path is:
There we will run the following command:
All we need to do now is reboot the machine (“reboot” command or shut down/restart using the GUI), and give it a test. You can run this command to see if you get an output like “vboxguest 434176 6” or similar:
lsmod | grep vboxguest
Soruce – LinuxConfig.org: