Ubuntu windows virtual machine. Installing Linux on a virtual machine

Today, many people work with the Windows operating system. However, not many people know that there are other operating systems. For example, the Linux operating system. This is a very popular OS among programmers, because the possibilities of this system are almost limitless. And, of course, like Windows, Linux has its own versions. They are called distributions. In this article I would like to pay attention to the Ubuntu distribution and its installation on virtual machine VirtualBox.

Why Ubuntu?

Before installation, you should understand why this particular distribution was chosen. Its most important difference from the others is its simplicity and accessibility. If you decide to study the Linux operating system, then you should start with Ubuntu. Before installing Ubuntu on the VirtualBox virtual machine, I would like to note several advantages of this distribution:

  • Popularity. Ubuntu is one of the most popular distributions"Linux". In most places where knowledge of this operating system is required, they pay attention specifically to the ability to work with Ubuntu.
  • Easy to learn. Due to its popularity, there are many lessons to learn. There is also quite a lot of documentation. And Ubuntu itself is more welcoming to beginners. For example, when compared with Kali Linux, then the difference is quite noticeable. This can be easily compared. For example, "Ubuntu" says: "Wait, don't do this, it might lead to a bad outcome." And Kali Linux: “Do what you want, but don’t regret it later.”
  • Each distribution is created for specific purposes. "Ubuntu" is ideal for learning, "Kali" is suitable for programmers who work with network testing, because the necessary scripts are already preinstalled there.
  • Design. "Ubuntu" has graphical shell. In general, previously Linux just had a console, and learning it was quite problematic. Then distribution kits with a graphical shell appeared, which made work and learning much easier.
  • It's easy to install drivers. The fact is that most device drivers are written only for the Windows operating system. If there is one for Linux, installation generally takes a lot of time and is done through the console. In Ubuntu, this is all made simpler, almost like in Windows.

Virtual machine or bootable USB flash drive?

So we looked at all the main advantages of the Ubuntu distribution. Have you decided to start learning, but don’t want to say goodbye to Windows? Then a virtual machine or bootable flash drive comes to the rescue. Briefly about them.

Bootable USB flash drive

In principle, the flash drive serves as hard drive, on which you install the operating system in order to run from it. It is enough to download the distribution kit, a special program, and literally in an hour this operating system will be installed on your flash drive, and you will be able to run from it. However, the changes you make there will not be saved. Unless, of course, you allocate a special area on the drive. This is also done using special program. In general, this is not very convenient, which is why people prefer installing Ubuntu on VirtualBox extension pack.

Virtual machine

It is installed on the Windows operating system and allows you to install other operating systems there, including Ubuntu. Installing Ubuntu on VirtualBox is much easier than installing on bootable USB flash drive, and it’s more convenient to work with a virtual machine. After all, you can watch the lessons, open the virtual machine and start trying right away. In this article, we will look at step-by-step instructions for installing Ubuntu 16.04 on VirtualBox. Of course, you can use more new version, for example 18.04 - there is no particular difference.

Before you can install Ubuntu on VirtualBox, you first need to download and install the virtual machine itself. In general, there are quite a lot of them, but VirtualBox is the most popular. Even on the official Ubuntu website, examples are presented there. You can download this program on the official website, it weighs little: 109 MB.

After VirtualBox has downloaded, open installation file. It looks like this:

Click the Next button. After this we see the following:

This shows the set of applications to be installed and the location where the virtual machine will be installed. It’s better not to change anything here except the installation location. You can choose any location, as long as there is enough memory for the program itself and the operating systems. Have you chosen? Click the Next button again.

Uncheck the boxes if you are against creating icons. Click "Next" again and it starts. installing VirtualBox.

During installation, the program will ask you to give permission to install devices. This should be allowed to avoid problems with the operation of the virtual machine. After successful installation, click on Finish. The program is installed! It looks like this:

Download the Ubuntu distribution

For VirtualBox you need to download the distribution itself, the so-called installation image. You can do this on the official Ubuntu website. You can download the most latest version- 18.04. You may also notice that you can download two versions: Desktop and Server. They differ in that the Desktop version is usually installed on permanent basis on computers, and Server is a bit simplified and ideal for virtual machines and boot disks. Therefore you should download Ubuntu version Server 18.04 for installation on VirtualBox.

Start installation

Everything is ready to install Ubuntu on VirtualBox, let's get started. Open the virtual machine and click on the “Create” button.

You can write absolutely any text in the “Name” field. For convenience, you can write the name of the distribution, in our case - Ubuntu. In the "Type" field, select the type of operating system that we are installing. In the "Version" field, select the distribution kit. After filling out, click “Next” and a new window will open:

Here you need to select the volume random access memory, which will be allocated for the operation of our operating system. For stable operation It’s better to allocate at least 2 GB. Although 1 GB is possible. In general, you should expect that when the virtual machine is running, the computer itself can operate stably. Since we are installing Ubuntu only to familiarize ourselves with the system, we will allocate 1 GB of RAM for it. Then click “Next”, and the following window appears in front of us.

Here you need to choose HDD, which your operating system will use to save data. You may not create it at all, but in this case all your changes in the system will not be saved. You can also create a new virtual hard disk or use an existing one. We don’t have one ready-made, so we’ll create it. Select "Create a new virtual hard disk" and click "Create". Then we see:

Here you select the file type to use when creating a new virtual hard disk. It’s better not to change anything, just click “Next”.

Here you should choose what your hard drive will be: dynamic or fixed. If you choose fixed, then when the maximum volume is reached, it will no longer save, but if you use dynamic, then it can expand if necessary. Who knows what you will encounter, so select “Dynamic” and move on.

We write the name of the virtual hard disk and indicate its size. Then click “Create”. The setup is complete, all that remains is to proceed directly to the installation!

Choosing an image

We click the “Launch” button, thereby launching our future operating system. And we see the following:

Remember, we downloaded the installation Ubuntu image for installation on VirtualBox. So, now you need to provide it to the program so that the installation can begin. Click on the folder icon and select the image that you downloaded. Then click “Continue”.

Installing Ubuntu

After clicking the "Continue" button, we can notice that the installation of the distribution has begun.

We wait for some time. He will ask you to choose a language - choose Russian. Well, or any other one that is most convenient for you to work with. The installation of Ubuntu on VirtualBox will continue after this. During the installation, many windows will appear where it is better to just click “Finish”. It will also ask you to enter your name and password. These should be remembered so that you can access them in the future. operating system.

Let's sum it up

The installation takes 15-30 minutes, after which the operating system itself starts. As you can see, installing Ubuntu on a virtual machine is quite easy and takes little time. Good luck with your studies!

In this article, we will take a detailed look at how to install Linux Ubuntu on a program for creating a virtual machine on a computer.

This approach to installation will help you test the system you are interested in in a convenient form, eliminating a number of complex manipulations, including the need to reinstall the main OS and disk partitioning.

Stage 1: Preparing for installation

  1. To get started, launch VirtualBox. Click on the button "Create".
  2. After this, a small window will open in which you have to manually enter the name of the virtual machine to be created in the field. In the drop-down lists, indicate the most suitable options. Check if your selection matches the one shown in the image. If yes, then you did everything right. Click "Next".
  3. You see a window in front of you in which you should indicate how much computer RAM you are willing to allocate for the needs of the virtual machine. The value can be changed using the slider or in the window on the right. The range of values ​​that are more preferable for selection is highlighted in green. After performing the manipulations, press "Next".
  4. The program will prompt you to decide where the data storage of the new operating system will be located. It is recommended to allocate 10 gigabytes for this. For operating systems like Linux, this is more than enough. Leave the default selection. Click "Create".
  5. You have a choice between three types:
    • VDI. Suitable for simple purposes, when you do not have any global tasks, but just want to test the OS, ideal for home use.
    • VHD. Its features include data exchange with the file system, security, recovery and backup(if necessary), it is also possible to convert physical disks into virtual ones.
    • WMDK. It has similar capabilities to the second type. It is more often used in professional activities.

    Make your choice or leave the default option. Click "Next".

  6. Decide on the storage format. If you have a lot of free space on your computer hard drive, feel free to choose "Dynamic", but remember that it will be difficult for you to control the space allocation process in the future. If you want to know exactly how much memory a virtual machine will take up and do not want this indicator to change, click on "Fixed". Click the button "Next".
  7. Specify the name and size of the virtual hard disk. You can leave the default value. Press the button "Create".
  8. The program will take time to creating a hard disk. Wait for the process to complete.

Stage 2: Working with the disk image


Stage 3: Installation


Stage 4: Familiarization with the operating system


In fact, installing Ubuntu on a virtual machine is not that difficult. You don't have to be for this experienced user. You just need to carefully read the instructions during the installation process, and everything will work out!

The Linux operating system is of interest to many users, but only a few decide to switch to it - the habit of using it takes its toll. Microsoft products. But you can break any habit: Windows will gradually be forgotten if you first figure out how to install Linux on a virtual machine.

To solve this problem you will need:

  • Processor support for hardware virtualization.
  • Oracle VM Virtual Box program.
  • Linux distribution downloaded as an ISO image.

After quick installation program, you can begin to complete the task.

Creating a virtual machine

We have already discussed in detail how to install a virtual machine on Windows 7 in the article of the same name. There you will find out everything necessary information about checking for hardware virtualization and enabling this feature in the BIOS.

On Linux kernel created great amount distributions, but now we will focus on one of the most popular systems– Ubuntu. You can use the same instructions to install Linux Fedora, Mageia, Gentoo, Puppy, etc.

The virtual machine has been created, but is currently disabled.
To enable it, click the “Run” button located on top line, or simply double-click on the machine itself with the left button.

Possible problems

When starting a virtual machine, some users encounter the error E_FAIL (0x80004005), indicating that the session cannot be completed.
You can find several solutions to this problem on the Internet, but the most popular are three methods:

  1. Extension changes configuration files virtual machine from *.prev and *.tmp to *.xml.
  2. Removal Windows updates KB3004394.
  3. Installation stable version VirtualBox.

The first two methods most likely will not help you. But installing a stable version in almost all cases allows you to solve the startup problem that has arisen. So it’s better to immediately install a proven version of VirtualBox (for example, 4.3.12) and don’t bother with configuration files.

Installing Linux

Procedure Linux installations Ubuntu is extremely simplified and does not require any special knowledge. After clicking the “Run” button, the installation wizard will start, in the window of which you need to specify the path to the previously downloaded Ubuntu ISO image.

After selecting the distribution, the installer start window will appear. Specify Russian in the menu on the left to understand everything that will be written on the screen during installation.

There are two options for further action:

  • Try Ubuntu - the operating system will start directly from the distribution kit without installation on a virtual machine.
  • Install Ubuntu – full installation systems with all components.

In principle, you can choose the first option, but for full immersion in the environment Ubuntu is better install the system anyway. Therefore, click the “Install” button.


After successful installation, the virtual machine will automatically reboot. After restarting, you are taken to the Ubuntu desktop.

When talking about creating a virtual machine, we indicated the minimum system requirements, subject to which Linux will work.

It will be better if you allocate a little more resources for the virtual operating system - with a minimum, it works slowly and is not always stable.


If your settings seriously exceed the minimum system requirements, you will immediately notice an increase in performance. In this case, your main operating system will not be affected - the main thing is not to run resource-intensive applications simultaneously with the virtual machine.

Oracle VM VirtualBox- this is a kit application programs, system services and drivers that emulate new computer hardware in the operating system environment where VirtualBox is installed. On virtual computer(virtual machine) you can install almost any operating system (guest OS) and use it in parallel with the main one. So, for example, on real computer with Windows you can install a virtual machine (VM - Virtual Machine) with operating system Linux family and use both operating systems at the same time. In addition, you can configure the interaction between these systems according to local network, data exchange via removable media, shared folders etc. Also, the current state of the virtual machine (and the state of the operating system installed on it) can be recorded, and, if necessary, at any time, a full rollback to this state can be performed. In other words, a virtual machine is very convenient tool for learning new operating systems, debugging software, conducting experiments without disrupting the operation of the main OS, researching viruses, diagnostic and recovery tools, and just for parallel work multiple operating systems on one computer.

Installing Oracle VM Virtualbox

   The current version of Oracle VM VirtualBox can be downloaded on the project download page, where download links are located installation packages for Windows x86/x64, Linux, Solaris and OS X.

Installation in Windows environment must be performed under account user with administrator rights.

During the further installation of VirtualBox, a warning will be issued:

This means that when installing network drivers VirtualBox, current ones will be reset network connections and there will be a temporary disconnection from the network. If, for example, in parallel with the installation, data is exchanged with network drive, it will fail with an error. If you are not working on the network, then briefly disabling the adapters will have no effect, and you should allow the installation to continue by pressing a button Yes. Otherwise, you must first exit with network resources.

After the installation is complete, the main software module VirtualBox user - Oracle VM VirtualBox Manager (Oracle VM VirtualBox manager):

Installing Linux Ubuntu on an Oracle VM VirtualBox virtual machine

    All actions to create virtual machines, change their settings, import and export configurations, etc. can be performed using the Oracle VM VirtualBox Manager (in Russian software - Oracle VM VirtualBox Manager) or using the utility command line VboxManage.exe. The latter has somewhat greater capabilities for setting up virtual machines, but is more difficult to use.

Installing a guest OS on a virtual machine can be roughly divided into 2 stages:

Creating the required virtual machine using VirtualBox;

The boot source (media with the Linux distribution) is determined by the virtual machine settings. It can be a real or virtual CD/DVD drive, floppy disk, HDD, image boot disk or local network. By default, the boot order is as follows - floppy disk, CD-ROM, hard disk, Network. This order can be changed in the virtual machine settings.

When you launch VirtualBox for the first time, the main program window appears with a welcome message and activated button Create to create a new VM:

When creating a new virtual machine, the following parameters are defined:

Virtual machine name. In accordance with it, a directory with virtual machine files will be created. By default this is a subdirectory in C:\Documents and Settings\Username\VirtualBox VMs\ in Windows XP environment and C:\Users\User\VirtualBox VMs\ for Windows 7 and older.

The type of operating system that will be installed on the virtual machine. IN in this case- Linux

OS version. In this case, Ubuntu.

Other parameters can be left as default, since they are already selected based on the hardware configuration real car and in accordance with the type and version of the operating system installed on the virtual one. If necessary, the parameters can be determined based on your own preferences, for example, increasing the amount of RAM allocated to the virtual machine.

Here is an example of allocating 1024 MB of RAM to a virtual machine, instead of the recommended 512 MB. When allocating memory, you need to take into account its actual size and the minimum requirements of the guest OS. If you have difficulty selecting this item, use the values ​​recommended by the program. Improper memory allocation between the real and virtual machines can result in poor performance for both.

A virtual machine's hard disk (virtual hard disk) is a file special format in the file Windows system. Virtual disk can be created either dynamic or fixed. Dynamic disk is created not for the entire volume specified by the setting, but for part of it, and increases as needed during the operation of the virtual machine. For getting maximum performance guest operating system, it is better to choose a fixed virtual hard disk, and to save disk space- dynamic.

VirtualBox allows you to use multiple various formats virtual disk data:

Most of the parameters defined during the creation of a new virtual machine can, if necessary, be changed at any time.

For the created virtual machine it becomes active button Tune, which allows you to change some of its settings, add or remove virtual devices, change their operating modes, and manage the distribution of resources of the real operating system. To get acquainted with the guest OS Ubuntu Linux is enough initial settings performed when creating the virtual machine. Therefore, you can immediately start launching the VM by pressing the button Launch. After the VM starts, a message about usage is displayed on the screen Automatic keyboard capture

This means that when the cursor is within the VM window, keyboard input will be performed for the virtual machine. By default, to switch keyboard input between real and virtual machine windows, use right Ctrl. The current input state is displayed in the status bar at the bottom of the virtual machine window.

Green color arrows in mean that keyboard input will be performed for the virtual machine, gray - for the real one.

To install the operating system on a virtual machine, you will need to boot from installation disk. In the VirtualBox environment, it is possible to boot from not only standard devices(CD/DVD drive, flash drive, network...) but also using a virtual drive created based on the boot disk image. Usually Linux distributions distributed as image files in ISO-9660 format (files with the extension iso) and VirtualBox allows you to do without burning the image to a CD, but simply connect such a file directly to the virtual machine as a virtual drive with installed media based on the contents of the iso image. When you start a virtual machine for the first time, when there is no guest operating system installed yet, VirtualBox will prompt you to select a boot device

Instead of a physical drive, you can select an image file, for example ubuntu-13.04-desktop-i386.iso, which will be connected as virtual device with installation CD/DVD Ubuntu disk 13.04. When you press the button Continue The virtual drive will boot and the installation of the guest operating system (Ubuntu) will begin.

The process of installing a guest OS is no different from installing it on a real machine. You can select the language for the installed system (usually Russian), time zone, keyboard layout, etc. Most parameters can be left at default, including type of instalation

During the installation process, you must specify the computer name, user, password and login mode:

The rest of the Ubuntu installation proceeds without any user intervention and ends with prompts to restart the computer. Compared to installing the system on a real computer equipment, installation on a virtual machine is slower, which is to be expected. The degree of performance degradation mainly depends on the speed of the actual computer hardware.

When you first boot a newly installed operating system, VirtualBox Manager will automatically disable virtual drive based on disk image with Ubuntu distribution, the boot will be performed from the virtual hard disk and upon completion, a login prompt will be displayed on the screen.

Changing Oracle VM VirtualBox Virtual Machine Settings

    In some cases, such as when a virtual machine is included in a real local network as a peer node with the ability external connection to his network services, you will need to change some default settings when creating the VM.

In the VirtualBox environment it is possible to use 4 virtual networks Ethernet adapters configurable in the virtual machine properties window on the tab Net

When you press the button Additionally values ​​are revealed additional parameters virtual network adapters, allowing you to select the type of adapter that will be used by the virtual machine driver, promiscuous mode, when the virtual adapter will accept all Ethernet frames regardless of the MAC address of the receiver, the MAC address value that is assigned to the virtual network card.

For each network adapter you can specify in which of the following modes they will operate (field Connection type):

Not connected- In this mode, VirtualBox tells the guest OS that the network adapter is present in the hardware configuration, but it is not connected - as if Ethernet cable was not attached to the card.

NAT (Network Address Translation)- the main connection mode, set by default when creating a virtual machine. Allows for the simplest implementation network access using client software (mail, Web, Skype, etc.)

Network bridge - bridge mode between the virtual and real network adapter, when data exchange between them is carried out directly without any changes in the guest OS environment. This mode allows you to access the network services of the guest OS in the same way as for regular real hosts on the local network. Using this mode, you can easily simulate a local network of real and (or) virtual machines.

Internal network- used to create virtual network accessible from the virtual machine, but inaccessible from real applications.

Virtual Host Adapter- used to create a local network of virtual machines and a real machine where VirtualBox operates (host machines). This mode does not use communication through a physical network adapter, like communication through a loopback interface.

Universal driver(generic network interface) - allows you to include a user-selectable driver in VirtualBox with additional extensions to combine virtual machines running on different hosts.

To include a virtual machine in an existing local network with the ability to access its network services, use the mode Network bridge and setting up the virtual network adapter so that its IP address is included in the local network address range. For example, for a local network 192.168.0.0/255.255.255.0 needs to be assigned virtual adapter(manually or automatically via DHCP) a free address from the range 192.168.0.1-192.168.0.254.

The first step is in the settings of the newly created virtual machine, in the section Net The VirtualBox manager for the network adapter needs to be changed Connection type NAT on Network bridge. Then, using the guest OS tools (in this case, Ubuntu tools) set a new IP address value. This can be done using System parameters - Net- Select a connection and press the button Options

To change the IP address you need to select the "Manual" mode

In the VirtualBox environment, just like on a real computer with an operating system Linux system, you can use several virtual terminals, to switch between them using a key combination CTRL - ALT + F1...F6(from the first terminal to the 6th). Thus, if necessary, you can simultaneously open several user sessions on different terminals and use them simultaneously. To switch to the graphical shell, use CTRL-ALT+F7. On different distributions Key combinations for switching may differ. When changing or viewing system settings that require you to run commands as root, you can, for example, use the first terminal, with registration in the context of a superuser account. The second terminal (as well as a graphical one) can be used under the account regular user.

To switch to account context root you need to run the command su on behalf of the superuser.

sudo su- go to the console with rights root

su allows you to execute a command as another user. If the username is not specified, it is assumed root. Work under an account root It is not recommended because incorrect actions can lead to serious damage or even crash of the system.

To view the current network settings the command is used ifconfig. When executed without parameters, it displays current settings for all network interfaces:

eth0 Link encap:Ethernet HWaddr A8:00:97:6E:e9:65
         inet addr:192.168.50.8 Bcast:192.168.0.255 Mask:255.255.255.0
         inet6 addr: fe80::a00:27ff:fe6b:e965/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:124 errors:0 dropped:0 overruns:0 frame:0
         TX packets:166 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:28340 (28.3 KB) TX bytes:19383 (19.3 KB)

Lo    Link encap:Local loop (Loopback)
         inet addr:127.0.0.1 Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING MTU:65536 Metric:1
         RX packets:144 errors:0 dropped:0 overruns:0 frame:0
         TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:12445 (12.4 KB) TX bytes:12445 (12.4 KB)

In this case, information about 2 network interfaces, eth0 And lo. The first one with a name eth0 is the local interface Ethernet networks and created on the network card with MAC address A8:00:97:6E:e9:65 And IP address 192.168.50.8. Second - lo is a loopback interface with IP address 127.0.0.1, typically used to emulate data transfer within a given system.

If desired, finished image A VirtualBox virtual machine with Linux Ubuntu installed can be downloaded from. Typically, the bootable image of the virtual machine reflects its state when the Ubuntu installation is completed when using standard parameters. The login username and password are provided on the download page.

The Sourceforge project also supports a page for downloading images of VirtualBox virtual machines with installed operating systems Android systems, FreeBSD, OpenSolaris and several dozen varieties of Linux.

For maximum flexibility, starting from version VirtualBox 4.0, a remote control mechanism has been implemented virtual machines via additional VirtualBox interface Remote Desktop Extension (VRDE). Basic package VirtualBox only provides support of this interface, and the support itself is implemented in the form of additional external module(plugin) VirtualBox extension package, which can be downloaded and installed as an addition to the basic package from the official website. Installation of this module performed double click by downloaded file with extension vbox-extpack.

Linux OS is interesting to many users, but few dare to change to her Windows. However, if you delve into the essence of how this platform works, you will see that Windows is not the only possible variant(especially considering its high cost). First you need to understand how Linux way installed on a virtual machine.

What is needed to achieve this goal?

1. The processor must support hardware rendering
2. Installed application VM VirtualBox from Oracle (hereinafter referred to as VB)
3. Downloaded ISO image of the Linux operating system

Having installed a virtual machine (this is quite fast process), you can deal with the Linux OS itself.

Today you can find many variations of Linux developed on its kernel. Now we will look at the most common of them - Ubuntu OS.

1. Launch VB and click "Create".

Specify the VM name - Ubuntu, as well as OS type – Linux. You must also specify the platform version; it depends on the bit depth of the loaded OS - 32x or 64x.

2. We set the amount of RAM that should be allocated for the operation of the VM. In this case, the operating system will function normally with a volume of 1024 MB.

3. We create new hard disk. Select the file type that is used when creating a new disk image. It is best to leave the item active VDI.



If we want the disk to be dynamic, then check the corresponding parameter. This will allow the disk space to grow as the VM fills with files.

We created a VM, but it is not active now. To enable it, you need to launch it by clicking on the button corresponding to the name. Or you can double-click on the VM itself.

Linux installation

Installing Ubuntu is as simple as possible and does not require any special skills. After starting the VM, the installation program window will appear. It should indicate the location of the downloaded Ubuntu image.

With this image selected, we'll move on to next step. In the new window, select the interface language – Russian, so that the installation process is completely understandable.

You can get an idea of ​​the operating system in the first case, but a complete installation will allow you to better immerse yourself in its environment. Let's choose "Install".

After this, the installation preparation window will appear. Let's check whether the PC parameters are consistent with the developers' requirements. If yes, let's move on to the next step.

During installation, select the option that offers to erase the disk and install Ubuntu.

During the installation process, you can set the time zone and specify the keyboard layout.

The installation procedure will take approximately 20 minutes.

After its completion there will be automatic reboot PC, after which the desktop of the installed Ubuntu will launch.

Installation Linux Ubuntu completed, you can begin to get acquainted with the system.