Tutorials

▷ How to create virtual machine in virtualbox and configure it

Table of contents:

Anonim

We have already talked enough about VirtualBox and the usefulness of this application. In this article we will see how to create a virtual machine in VirtualBox explaining in detail the process of creating it. In addition, we will explain in detail some important settings such as the internal network of the virtual machine, adding hard drives to it, such as sharing a folder from the host computer to the virtual machine, using the host keys and cloning, exporting and importing machines.

Index of contents

VirtualBox is one of the most complete free solutions there is to create a virtual machine on our team. and today we will see a practical demonstration of how to create a virtual machine in the most complete way possible. Prepare your VirtualBox and follow the steps with us.

Now, we start with the installation process and much more.

Create VirtualBox virtual machine

The first thing we are going to do is create a new virtual machine from scratch. The operating system that we are going to use will be taken from an ISO file downloaded using the Media Creation Tool application from Microsoft. Let's start the process.

  • The first thing to do is open VirtualBox and hit the " create " button. In this way we will start the virtual machine creation wizard. A window will appear in which we must press the lower button " Expert Mode "

  • On the first screen we put the name of the machine and choose which system we want to install. We must also assign a quantity of RAM to the virtual machine. Depending on what we have available in our team, we can assign a custom quantity. As it is a new virtual machine, we choose the option " Create a new virtual hard disk " Once everything is ready, click on " Create "

  • To choose a directory where to create our machine, click on the folder icon with the green arrow in the upper right. Now we must assign the amount of storage to the virtual hard disk. We can assign what we really want, because VirtualBox will create this space dynamically on the physical hard drive. We choose the option " Dynamically reserved " As an extension of the virtual hard drive we recommend choosing VDI (native of VirtualBox) or VMDK (native of VMware) or VHD (native of Windows virtual disks) Now click on " Create "

Insert ISO Image to install operating system in VirtualBox

The virtual machine will be created, but now we must configure other extra basic parameters such as CPU or install the operating system from an ISO.

  • To open the configuration options of the virtual machine we must click on the virtual machine create with the right button and choose " Configuration "

  • We go to the " System " tab and go to the " Processor " tab We will choose how many cores the virtual machine can use

  • The next step will be to associate the ISO image of the operating system with the virtual machine in order to install the system. We click on " Storage " We select the CD icon in the " Storage devices " section On the right side, we click on the CD icon again and click on “ Select virtual optical disk file

  • Now we will have to look in the file exporter where we have stored our ISO image of the operating system

With everything ready for now, click on " Accept ". Later we will see in detail all the configuration of the virtual machine

Installation of the operating system

  • To start the virtual machine, click on the " Start " button with the large green arrow

  • The ISO image CD will automatically start as if it were a normal computer without an installed system.

The installation process is carried out as it is normally done on a physical computer so we will not go into the process in detail

We will already have created our virtual machine with an operating system installed on the virtual hard disk. Now we can do practically the same things that we do in our physical equipment.

Configure operating parameters of a virtual machine in VirtualBox

Let's see in more detail the different configuration parameters of a virtual machine. We will divide them according to where they are located and their level of importance.

Installation of VirtualBox Guest Additions

These tools are extremely useful to optimize the performance of our virtualized operating system.

To know how they are installed and the functions of these tools visit our tutorial:

Set up shared folder in VirtualBox

We must have VirtualBox Guest Addition installed on the virtual machine

In order to share a folder from the host computer to the virtual machine and allow it to see the files inside it, we will do the following:

  • On the main window we right-click on the virtual machine and choose " Configuration "

  • We are located on the option of " Shared folders " We click on the folder icon with the symbol "+" located on the right In the first line we select the folder of our physical equipment In the second line we put the name of the folder We activate the options that we see opportune of the three that appear

The folder will appear in the file explorer if we go to " This computer"

Activate shared clipboard and Disk Encryption in VirtualBox

These modifications must be made with the virtual machine powered off. These options will be located in the first option of the “ General ” configuration list.

VirtualBox shared clipboard

We must have VirtualBox Guest Addition installed on the virtual machine

Click on “ Advanced ” and choose the “ Bidirectional ” option in the “ Share clipboard ” and “ Drag and drop ” options. So we can interact directly between the host computer and the virtual machine to transfer files

Disk Encryption VirtualBox

If we want to encrypt the virtual machine to add security we will have to install VirtualBox Extension Pack.

To do this visit our tutorial:

Once the package is installed we go to the Disk Encryption tab. Here we activate the specific option and put a security password for access to the virtual machine. We will also have to choose an encryption system for the disk from the drop-down list.

VirtualBox host keys

The use of keyboard shortcuts is very normal in operating systems, and this is no exception in a virtual machine. For certain keyboard shortcuts if we use them on the virtual machine they will also have an effect on the physical one, for example " Ctrl + Alt + Del ".

To use certain key combinations that interfere with the host system, we must do the following:

  • With the virtual machine switched on, click on the “ Input ” toolbar. Next, click on “ Keyboard ”. If you want to activate a certain combination, click on it. This way it will not act on the host computer

If we also click on " Keyboard preferences " in the previous menu we will access all the key combinations that we can use both in the virtual machine and in the program itself

When the key combination says "Host +" it means that the first key is the "Right Ctrl" key

Expand VirtualBox hard drive

These modifications must be made with the virtual machine powered off. If we have to install a virtual machine and configure a certain amount of storage on this hard disk, we will not be able to modify it with the normal graphics method. Also, the created virtual hard disk must be configured as dynamic. That is why in the virtual machine creation section we choose this option. Let's see then how to do this procedure: (we start from a 50 GB virtual hard drive)

  • The first thing we must do is locate the directory where we have stored the virtual hard disk of the virtual machine. We will have to look for a file with the extension " .VDI ". In addition, we recommend making a backup copy in case something goes wrong. We point or copy this path because the we will use later

  • Now we go to the VirtualBox installation directory, generally it will be the following path:

C: \ Program Files \ Oracle \ VirtualBox

  • Now we must right-click on an empty place in the directory, at the same time we must press the " Shift " key. We choose the option " Open the PowerShell window here "

  • We will have to write the following command:

. \ VBoxManage.exe modifyhd " "--resize

For example, in our case it was: “. \ VBoxManage.exe modifyhd “ D: \ virtual machines \ Windows10 x64 Home \ Windows10 x64 Home.vdi ” –resize 80000 ”. In this way we will expand the hard drive to 80GB

  • Let's look at the results now. We will see that the disk has been expanded correctly

  • Now we start the virtual machine to see the changes. For this they will need to use the " Windows hard disk manager ". Since we will have to reassign this space manually from this tool, we right-click on the start menu and click on “ Disk management

  • We will see that now the increased space is in black, so it is not usable yet. We right click on the system partition and choose " Extend Volume "

  • We will only have to follow the wizard by clicking on " Next ". This will take up all the space and extend the entire partition

To learn in more detail how to use Windows Hard Drive Manager Visit this tutorial:

Add new hard drive to VirtualBox virtual machine

Expanding a virtual drive is relatively complex, if we do not want to do this we will also have the possibility to create and add another hard drive in the virtual machine. Let's see how it is:

  • We select the virtual machine and open its configuration We go to the " Storage " section

We will have the possibility to create a new disk controller to configure a new interface (IDE, SCSI, NVMe)

But we can also add a unit to the existing interface. To do this click on the blue icon with the symbol "+"

  • Click on " Create a hard disk ", and then " Create new disk " We will choose in the wizard, the file extension, the option to make it dynamic and the allocated space

In this way the hard disk will be created. We can also activate the options that it is a solid state unit that can be hot-plugged. Now we go to start the virtual machine

  • Inside the virtual machine already in operation, we will have to open the Hard Disk Manager. As if it were a disk that we just bought, the program will inform us that we must format the new disk. Press " Accept "

  • Then we right-click only the black space of the hard disk and choose " New simple volume " We follow the different steps of the wizard to correctly create the volume

You have detailed information about this in the tutorial about Hard Drive Manager

If this new formatted hard drive does not appear directly in the file explorer, we will restart the virtual machine

Configure VirtualBox internal network

This modification can be done without turning off the virtual machine, but with it turned off we can configure more parameters.

Another of the most important aspects to configure in a virtual machine is the network for its connection to the Internet and shared resources as if it were a physical computer.

To access the network configuration we will have to go to the virtual machine configuration, and go to the " Network " section. The options we have available will be the following:

  • Not Connected: the virtual machine will not be connected to a NAT network: Default configuration of the machine. Take the internet connection of the host computer to surf the internet. We will not be able to see other networked computers or share files with them. NAT Network: As the previous option, but with the possibility of having several machines running at the same time. Bridge adapter: simulates a physical connection by taking its own network adapter and obtaining an IP from the router. physical. Yes we can share files and connect to a physical network Internal network: the virtual machine will see the internal network but will not have access to the outside of it (Internet) Single-host adapter: the virtual machine will only connect to the host computer Generic controller: it will will assign a generic controller that exists in the physical equipment if it does not recognize the ones that we have available in VirtualBox

For us the most interesting are undoubtedly NAT Network and Bridge Adapter. Let's configure virtual machine c in bridged mode so that it is visible on the computer network of our workplace:

  • We choose the option " Bridge adapter " and press accept

  • We will immediately see the changes in our virtual machine. It will ask us to reconnect since the network has changed. Click on " Yes "

  • Now we can see the other computers on the network as if we were physically connected to the router

Export VirtualBox virtual machine

Exporting a virtual machine will help us to use this machine in other programs than VirtualBox. The most used format is OVF, which is supported by most hypervisors, for example, VMware (its creator). To export a virtual machine in VirtualBox we will do the following:

  • With the machine turned off, click on " File " and " Export virtualized service "

  • We select the machine in question and click " Next " We choose the destination directory for the file and the type of file to use, it may be OVF or OVA. The only difference is that OVA creates a single file with everything inside. Then we can add some extra information to the virtualized service. Finally, click on " Export "

To do the reverse process, we will have to click on " File -> Import virtualized service ". We will select the OVF or OVA package and follow the corresponding steps.

Clone virtual machine

In addition to exporting virtual machines, we can also clone any of them to avoid having to install an operating system on each one.

  • To do this, right click on the machine turned off and choose " Clone "

  • We choose a name and leave the option “Reini cialize the MAC address of the network cards ” active. We will only have to click on “ Clone ” and the process will begin. Now we can have two virtual machines exactly the same in our Hypervisor

Create virtual machine from a VirtualBox VDI or Virtual Disk Image

Another option that is one of the most useful that VirtalBox implements is that of being able to create a virtual machine from a virtual hard disk with the extension ".VDI" or the other supported ones already created. Thanks to this we will be able to download previously created virtual machines from the internet and directly be able to open them with VirtualBox.

  • Click on " New " and in the first window we choose the option " Use an existing virtual hard disk file " To search for the virtual machine click on the folder icon and the green arrow Once chosen and placed the name and number of RAM, we will only have to click on " Create "

Open VMware vmdk VirtualBox virtual machine

Similar to the previous section is the method to create and start a VMware virtual machine in VirtualBox. One of the most significant and useful features of VirtualBox is the fact of being able to open virtual machines made in other Hypervisors such as VMware.

  • Again click on the " New " button and choose the option " Use an existing virtual hard disk file " Click on the folder with the green arrow and choose the file with extension " .vmdk " own VMware

  • Once again, we configure RAM and name of the virtual machine. We give " Create " and the machine will be ready to work.

We can make all the settings of a VirtualBox virtual machine

We also recommend:

What virtual machine have you created? Leave us in the comments that this article has helped you. If you miss something, tell us and we will complete the tutorial

Tutorials

Editor's choice

Back to top button