Search...

Installation and setup of VirtualBox

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.):

  1. Installing VirtualBox
  2. Configuring VirtualBox
  3. Creating a new virtual machine
  4. Configuring the virtual machine
  5. Appendix – network configuration
  6. Appendix 2 – Configuring copy/paste between the host and the guest VirtualBox machines


1. Installing VirtualBox

In Software Manager search for "virtualbox" and click on it to install. You will be asked to enter your root password for the installation to commence.
In Software Manager search for “virtualbox” and click on it to install.
You will be asked to enter your root password for the installation to commence.
Picture 1

– T.O.C. –


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:

Choose File-Preferences (1), set the VM directory (2) and click "OK" (3)
Choose File-Preferences (1), set the VM directory (2) and click “OK” (3)
Picture 2

– T.O.C. –


3. Creating a new virtual machine

Now we need to create a new VM
Now we need to create a new VM
Picture 3
Choose a name for the VM (1), set the OS type it will be using (2) and OS version (3), then click "Next" (4)
Choose a name for the VM (1), set the OS type it will be using (2) and OS version (3), then click “Next” (4)
Picture 4

Clicking “Next” opens new screens with settings:

Set the amount of RAM that will be allotted to the VM (1) and click "Next" (2)
Set the amount of RAM that will be allotted to the VM (1) and click “Next” (2)
Picture 5
You should create a new virtual disk (1), unless you've already created one - click "Create" (2)
You should create a new virtual disk (1), unless you’ve already created one – click “Create” (2)
Picture 6
Choose the marked option (1) unless you have a very good reason to choose otherwise and click "Next" (2) VHD option is useful for remote VMs with slow network connections
Choose the marked option (1) unless you have a very good reason to choose otherwise and click “Next” (2)
VHD option is useful for remote VMs with slow network connections, because it creates several smaller files, not one large, like VDI does.
Picture 7
I prefer choosing a fixed size (1) so I know how much room there is on both the physical and virtual machine
I prefer choosing a fixed size (1) so I know how much room there is on both the physical and virtual machine, then click “Next” (2)
Picture 8
Choose the directory name where VM will be stored (1) and how much storage space will be allotted to it (2), then click "Create" (3)
Choose the directory name where VM will be stored (1) and how much storage space will be allotted to it (2), then click “Create” (3)
Picture 9

– T.O.C. –


4. Configuring the virtual machine

Now it is the time to configure the created VM.

Select the created VM (1) and click on "Settings" (2)
Select the created VM (1) and click on “Settings” (2)
Picture 10
Click "Storage" (1), select CD-ROM icon (2) and choose .iso file (3) with the OS installation (by browsing) - then click "OK" (4)
Click “Storage” (1), select CD-ROM icon (2) and choose .iso file (3) with the OS installation (by browsing) – then click “OK” (4) – IF you are using SSD, don’t click “OK”, but stay on this screen and look at the next picture.
Picture 11
If you are using a SSD, click "Storage" (1), then choose the VM file (2) and check SSD (3) - then click "OK" (4)
If you are using a SSD, click “Storage” (1), then choose the VM file (2) and check SSD (3) – then click “OK” (4)
It is on the same screen as picture 11
Picture 12
All that's left now is to run your newly crated VM It should boot from the selected .iso file
All that’s left now is to run your newly crated VM
It should boot from the selected .iso file
Picture 13

Finishing note – boot order can be altered as desired:

Select "System" (1), select virtual drive and move it up/down boot order list (2), then click "OK" (3)
Select “System” (1), select virtual drive and move it up/down boot order list (2), then click “OK” (3)
Picture 14

– T.O.C. –


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:

Click on "Global Tools" (1), then "Create" (2)
Click on “Global Tools” (1), then “Create” (2)
Picture 15

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.

Choose "Configure Adapter Manually" (1), then enter your host computer's IP address (2) and subnet mask (3)
Choose “Configure Adapter Manually” (1), then enter your host computer’s IP address (2) and subnet mask (3)
Click “Apply” when done (4)
Picture 16

On the “DHCP Server” tab, it can be configured, or disabled:

Either tick the "Enable Server" checkbox and configure VIrtualBox DHCP, or disable it (1) - then click "Apply" (2)
Either tick the “Enable Server” checkbox and configure VIrtualBox DHCP, or disable it (1) – then click “Apply” (2)
Picture 17

– T.O.C. –


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:

Opening VirtualBox guest machine settings
Opening VirtualBox guest machine settings
Picture 18

Next, we’ll configure the shared clipboard options and mount the “VirtualBox Guest Additions” iso file for our Linux guest machine:

VirtualBox shared clipboard and drag & drop options
VirtualBox shared clipboard and drag & drop options
Picture 19
Mounting the VirtualBox Guest Additions iso file
Mounting the VirtualBox Guest Additions iso file
Picture 20

The file is in the VirtualBox’s directory – in my case, that’s:
C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso

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:

cd /media/bikegremlin/VBox_GAs_7.0.2

There we will run the following command:

sudo ./VBoxLinuxAdditions.run

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:
https://linuxconfig.org/install-virtualbox-guest-additions-on-linux-guest

– T.O.C. –

1 thought on “Installation and setup of VirtualBox”

  1. This post is really helping me a lot initially I had no idea how to set up virtual box but when i read this article I got the idea of how can i set up the virtual box.

Comments are closed.


Please use the BikeGremlin.net forum for any comments or questions.

If you've found any errors or lacking information in the article(s) - please let me know by commenting on the BikeGremlin forum.
You can comment anonymously (by registering with any name/nickname), but I think it is good to publicly document all the article additions (and especially corrections) - even if their author chooses to remain anonymous.

Tools and other products that I use (and can recommend)

TOC
Skip to content