Перейти к содержимому

Как установить линукс на виртуальную машину virtualbox

  • автор:

Устанавливаем операционные системы семейства Linux на VirtualBox

Установка ОС Linux на VirtualBox

ОС Linux интересна многим пользователям, но не многие решаются сменить на нее Windows. Однако если вникнуть в суть работы этой платформы, станет видно, что Windows – не единственный возможный вариант (особенно, с учетом его дороговизны). Для начала нужно понять, каким образом Linux устанавливается на виртуальную машину.

Установка Linux на VirtualBox

Для того чтобы процедура была проведена без проблем, должны быть соблюдены следующие условия:

  • Процессор должен поддерживать аппаратную визуализацию VT-x или VT-d (для Интел), AMD-V (для АМД).
  • Должна быть установлена программа VM VirtualBox от Oracle.
  • На компьютере должен присутствовать скачанный ISO-образ операционной системы Linux.

Установив виртуальную машину (это довольно быстрый процесс), можно заняться собственно самой ОС Linux.

Сегодня можно встретить множество вариаций Linux, разработанных на ее ядре. Сейчас мы рассмотрим некоторые из них – Ubuntu, Kali Linux, Debian, CentOS и Remix OS.

Установка Extension Pack

Первым делом необходимо скачать на официальном сайте и установить специальный пакет расширений VirtualBox Extension Pack. Он позволяет программе иметь максимальную совместимость с дистрибутивами Linux. Подробная инструкция доступна по ссылке ниже.

Устанавливаем пакет расширений VirtualBox Extension Pack

Создание виртуальной машины

Создание виртуальной машины для Ubuntu

  1. Запускаем VirtualBox и жмем «Создать». Указываем имя виртуальной машины – Ubuntu, а также тип ОС – Linux. Нужно указать и версию платформы. Это зависит от того, какова разрядность загруженной ОС – 32х или 64х.
  2. Задаем объем ОЗУ, который следует выделить для работы «виртуалки. В данном случае операционная система будет функционировать нормально при объеме 1024 Мб.

Создание виртуальной машины для Ubuntu (3)

Выбираем тип файла, который используется при создании нового образа диска. Лучше всего оставить активным пункт VDI.

Мы создали ВМ, однако сейчас она не активна. Для ее включения необходимо осуществить ее запуск, нажав на соответствующую кнопку. Либо можно осуществить двойной клик по самой машине в списке.

Вариант 1: Установка Ubuntu

Установка Ubuntu максимально проста и не требует особых навыков.

    После запуска ВМ появится окно программы установки. В нем следует указать местонахождение загруженного образа Ubuntu.

Далее можно пойти двумя путями: либо протестировать Ubuntu, запустив ее с образа диска (при этом она не будет устанавливаться на виртуальный диск), либо выполнить ее полную установку. Получить представление об операционной системе можно и в первом случае, однако полная установка позволит лучше погрузиться в ее среду.

    Выберем «Установить». После этого появится окно подготовки к инсталляции. Проверим, согласуются ли параметры ПК с требованиями разработчиков. Если да, перейдем к следующему шагу.

Установка Linux Ubuntu завершена, можно начать знакомиться с системой. Далее мы поговорим о том, как устанавливать другие ОС семейства Линукс на VirtualBox.

Вариант 2: Установка Kali Linux

Данная система содержит в своем дистрибутиве множество специализированных программ, предназначенных для тестирования безопасности сетей и приложений. Установка Кали несколько отличается от такового процесса с Ubuntu и является более сложным в технической части.

Установка операционной системы Kali Linux в программе VirtualBox

Вариант 3: Установка Debian

Debian можно назвать основой Linux. Эта система отлично подходит для использования как в серверах, так и рабочих станциях. Она поддерживает множество архитектур и имеет самый большой репозиторий (хранилище) пакетов довольно широкого назначения.

Установка операционной системы Debian в программе VirtualBox

Вариант 4: Установка CentOS

CentOS основана на коммерческом дистрибутиве Red Hat Enterprise Linux компании Red Hat. В отличии от него, система распространяется бесплатно и, вместе с тем, совместима с RHEL.

Установка операционной системы CentOS в программе VirtualBox

Вариант 5: Установка Remix OS

Remix OS позволяет пользователям ПК использовать мобильные приложения, предназначенные для ОС Android на любом компьютере с процессором Intel. Система распространяется бесплатно, но имеет закрытый исходный код в отличии от большинства других дистрибутивов Linux.

Установка операционной системы RemixOS в программе VirtualBox

Мы сегодня познакомились с небольшой частью дистрибутивов Linux. Каким из них пользоваться, решайте сами, руководствуясь поставленными задачами, а VirtualBox поможет разобраться в особенностях и приобрести опыт.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7

In this tutorial, we’ll walk you through one of the easiest ways to try out Ubuntu Desktop on a virtual machine. VirtualBox is a general purpose virtualiser that is available across Linux, Mac OS and Windows. It’s a great way to experience Ubuntu regardless of your current operating system.

VirtualBox 7 and above includes a new feature called Unattended Guest OS Install which significantly streamlines the setup experience for common operating systems like Ubuntu, making it easier than ever to get started.

Note: This tutorial will also work for other distributions, so try it out with some of the Ubuntu flavours as well!

What you’ll learn

  • How to install and configure VirtualBox
  • How to import an Ubuntu image
  • How to run a virtual instance of Ubuntu Desktop
  • Further configuration options

What you’ll need

  • A PC with internet access!

Download an Ubuntu Image

You can download an Ubuntu image here. Make sure to save it to a memorable location on your PC! For this tutorial, we will use the latest Ubuntu 22.10 release.

image

Download and install VirtualBox

You can download VirtualBox from the downloads page here. This page includes instructions on how to install VirtualBox for your specific OS so we won’t repeat those here.

Once you have completed the installation, go ahead and run VirtualBox.

2. Create a new virtual machine

Click New to create a new virtual machine. Fill in the appropriate details:

  • Name: If you include the word Ubuntu in your name the Type and Version will auto-update.
  • Machine Folder: This is where your virtual machines will be stored so you can resume working on them whenever you like.
  • ISO Image: Here you need to add a link to the ISO you downloaded from the Ubuntu website.

We want to install Ubuntu unattendedly so we can leave the checkbox to skip unchecked.

Create a user profile

To enable the automatic install we need to prepopulate our username and password here in addition to our machine name so that it can be configured automatically during first boot.

The default credentials are:

  • Username: vboxuser
  • Password: changeme

It is important to change these values since the defaults will create a user without sudo access.

Ensure your Hostname has no spaces to proceed!

It is also recommended to check the Guest Additions box to install the default Guest Additions ISO that is downloaded as part of VirtualBox. Guest additions enables a number of quality of life features such as changing resolution and dynamic screen resizing so it is highly recommended!

Note: If you choose not to use unattended install then this step will be skipped and you will go straight to the following screen. Once your machine has been created you will be able to create a username and password by proceeding through the standard Ubuntu Desktop installation flow on first boot.

Define the Virtual Machine’s resources

In the next section we can specifiy how much of our host machine’s memory and processors the virtual machine can use. For good performance it’s recommended to provide your VM with around 8GB of RAM (althought 4GB will still be usable) and 4 CPUs. Try to remain in the green areas of each slider to prevent issues with your machine running both the VM and the host OS.

Then we need to specify the size of the hard disc for the virtual machine. For Ubuntu we recommend around 25 GB as a minimum. By default the hard disk will scale dynamically as more memory is required up to the defined limit. If you want to pre-allocate the full amount, check the ‘Pre-allocate Full Size’ check box. This will improve performance but may take up unnecessary space.

Click Next to continue and view a summary of your machine setting.

After this click Finish to initialize the machine!

3. Install your image

Click Start to launch the virtual machine.

You will see a message saying ‘Powering VM up …’ and your desktop window will appear.

On first boot the unattended installation will kick in so do not interact with the prompt to ‘Try and Install Ubuntu’ and let it progress automatically to the splash screen and into the installer.

Note: If you chose not to use unattended install then you will need to progress through the Ubuntu install manually. Check out our Ubuntu Desktop installation tutorial for more details.

You will notice at this stage that the resolution of the window is fixed at 800×600. This is because the Guest Additions features are not installed until after the Ubuntu installation has completed.

Once the installation completes, the machine will automatically reboot to complete the installation.

Finally you will be greeted with the Ubuntu log-in screen where you can enter your username and password defined during the initial setup (don’t forget that the default password is ‘changeme’ if you left everything as the default).

4. Explore Virtual Box

Enjoy your shiny new Ubuntu Desktop!

As always we recommend opening a terminal and running sudo apt update && sudo apt upgrade -y and then sudo snap refresh to get everything updated to the latest versions.

Once you’ve finished your session you can close your machine by clicking the X in the top right of the window and choosing whether to keep your machine frozen in its current state or shut it down completely.

As you can probably tell, there are tonnes of further configuration options available in VirtualBox and we’ve only scratched the surface.

VirtualBox allows you to create and configure multiple virtual machines, so don’t be afraid to create new instances of Ubuntu to try out different system and storage configurations to fine tune your performance.

Why not try following the tutorial above with one of the Ubuntu flavours!

How to Install Ubuntu on Desktop (Laptop or PC)

How to Install Ubuntu on Desktop (Laptop or PC)

Choosing which Linux distribution to install can seem challenging as there are many versions to choose from, and each of them offers very different features. One popular distribution to consider is Ubuntu.

It is arguably one of the best Linux distributions available. It is simple to use, easily customizable, and scalable based on users’ needs.

This article will go over the two methods of installing Ubuntu with GUI on your PC or laptop. We will also include the requirements and all the needed configuration settings for installing Ubuntu.

Requirements for Installing Ubuntu on Desktop

To install Ubuntu on a desktop, your computer has to meet these requirements:

  • 2 GHz dual-core processor or better
  • At least 4 GB of RAM
  • 25 GB of free disk space
  • USB port and a USB stick with at least 4GB capacity

Keep in mind that these installation methods work only with desktop computers and won’t suit VPS users as we are installing Ubuntu with a graphical interface. If you prefer a command-line interface, consider opting for a VPS solution instead.

How to Install Ubuntu Wiping Out the Old Operating System

Wiping out all the data from the hard drive is the cleanest way to install Ubuntu Desktop. This way, users delete old operating system files and install a fresh Ubuntu version.

Check out the comparison table below for the differences between applying this method and the virtual machine.

Official download page for desktop Linux distribution – Ubuntu 22.04 LTS. Red border indicating the download button

Users can also choose between Ubuntu Server and other Ubuntu flavors. However, the main Ubuntu Desktop version has all the essential features a beginner needs.

2. Create a Bootable USB

After downloading the ISO file, you will need to create a bootable USB drive, which will be used to install Ubuntu. To do so, you will have to use third-party software, such as Rufus. We recommend downloading the portable version as it won’t require any installation and will be ready to use right away.

Official download page for Rufus 3.18 Portable. It is used to mount ISO files to USB devices

Just open the executable file, and Rufus will start. Once done, ensure that the USB drive is plugged in and select the Ubuntu ISO file.

Important! For the partition scheme, select GPT if you are using a newer computer. Otherwise, go with MBR.

Drive Properties section on the Rufus program

As for Format Options, leave the default file system and cluster size values and click on START.

Format Options section on the Rufus program

Important! Creating a bootable USB stick will wipe out all the data from the USB drive. Make sure to back it up before proceeding.

Give it around ten minutes, and the bootable USB drive will be ready.

3. Install Ubuntu OS From the USB

With the Ubuntu bootable drive ready, proceed with the installation. For that, restart your computer and access BIOS. Usually, BIOS can be reached by pressing the DEL or F2 keys on the keyboard whenever a similar screen shows up:

Default bios boot up screen for ASUS motherboard

Pro Tip

In case you missed the BIOS screen, restart your computer and try again.

Once in BIOS, look for the boot menu and set the order to make the USB drive the first one on the list. It should look like this:

Boot Priority settings for MSI BIOS

Now save and close BIOS. Give it a few minutes, and the Ubuntu installer should start. Once it begins, proceed to the next section about the Ubuntu installer.

How to Install Ubuntu on Windows Using VirtualBox

If you don’t want to wipe your hard drive completely, go with the VirtualBox installation method. This will install Ubuntu inside a virtual machine, making it completely independent of the primary system.

This method is excellent for those who want to test out different Linux distributions or install third-party software packages for Ubuntu.

Pro Tip

The virtual machine installation method allows you to install Ubuntu alongside other operating systems on the same computer.

1. Download and Install VirtualBox

Start by downloading the newest version of Oracle VirtualBox. Once done, open the executable file and proceed with the installation.

VirtualBox installation process

When asked about network interfaces, select Yes. Note that the internet connection might go down for a few minutes during the installation.

VirtualBox installer network interfaces warning

Next, proceed with the default installation settings.

2. Download and Install Linux ISO

After installing VirtualBox, open it by using the desktop shortcut and select New to create a new virtual machine.

Specify the virtual machine name and select the amount of RAM to be assigned. We recommend giving half the amount of the main system. For example, if the computer has 8 GB of RAM, assign 4 GB to the virtual machine.

There is also an option to specify a virtual hard disk since it’s a fresh installation – go with the default settings and click on Create.

VirtualBox window to specify the virtual machine name and memory size

Next up, choose the file location for the virtual machine, specify file size and click on Create. We will be keeping the default hard disk file type and dynamically allocated storage. Dynamic storage saves a lot of space because it grows as the data inside the virtual disk increases. On the other hand, fixed storage takes up the full amount right from the start.

VirtualBox window to specify hard drive size, type and storage

The virtual machine is now created. However, it will show an error message about no boot device. To fix it, select Settings, as you will need to assign the Ubuntu ISO file downloaded earlier.

Once in the settings, open the Storage section and assign the ISO file to the Controller: IDE.

VirtualBox window showing how to mount ISO file to DVD drive

The end result will look like this:

VirtualBox storage settings

Now, you can start the virtual machine without any issues.

Give it a few minutes, and the Ubuntu installer should start. Then, proceed to the next section about the Ubuntu installer.

How to Proceed With Ubuntu Installer

When the system boots to the new Ubuntu installation screen, select the Try or Install Ubuntu option.

The first step in the Ubuntu installation process. Try or Install Ubuntu button is selected

Select the installer language and choose the Install Ubuntu option in the next step. There is also an option to test Ubuntu. In that case, none of the hard drive files would get wiped. However, we are proceeding with the full installation.

Ubuntu installer step to choose the main language. The red border indicates the button to install Ubuntu

Choose the preferred keyboard layout and continue.

Ubuntu keyboard layout settings

Now you can choose between the Normal and Minimal installations. We recommend sticking with the Normal installation since it offers more helpful utilities and software packages. Additionally, select the option to download updates to get the latest possible version.

Ubuntu installer step to select update settings and specify if an user wants normal or minimal installation

For the Installation type, choose Erase disk and install Ubuntu.

Ubuntu installer step to select the installation type

When asked about partition, click on Continue.

Ubuntu installer step warning user about the root partition that will be created

Next up, select the timezone.

Ubuntu installer step allowing user to select their timezone

Lastly, fill in the name, username, and password.

Ubuntu installer step to specify new operating system user

After clicking continue, Ubuntu installation will start. Give it about 20 minutes and restart the computer after installation is done. Once the computer boots up, you should see the default welcome screen.

Ubuntu default desktop screen

Congratulations – you have successfully installed Ubuntu 22.04 on your computer.

Conclusion

Due to its simplicity and versatility, Ubuntu is often the go-to choice for an operating system. Although, not all Linux beginners might know how to install it.

In this tutorial, we’ve covered the main points of Ubuntu installation:

  • Requirements to install Ubuntu Linux on a desktop computer.
  • How to make a bootable Ubuntu 22.04 LTS USB device with Rufus.
  • How to install Ubuntu on a physical Windows machine by wiping out the old operating system.
  • How to install Ubuntu on a virtual machine by using Oracle VirtualBox software.

We hope that you have learned the main aspects of installing Ubuntu. If you have any questions, leave them in the comments section below.

Suggested Reading

Author

Ignas takes great satisfaction in helping people tackle even the most complex technical issues. His current goal is to write easy-to-follow articles so that these issues will not happen at all. During his free time, Ignas likes to play video games and fix up things around his house.

Install Ubuntu on Oracle VirtualBox

Oracle VirtualBox is a cross-platform virtualization application. It installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. VirtualBox can create and run a «guest» operating system (virtual machine) in a window of the host operating system. The virtual machine provides a self-contained environment in which to experiment with new software without risking damaging changes to the host operating system.

We will give an instruction with step-by-step screenshots to show how to install VirtualBox with an example of installing Ubuntu OS as a guest machine. We also explain how to share files between the host and guest operating systems.

Downloads

Note the instruction here is based on the latest version of the VirtualBox. If you have already installed an earlier version of VirtualBox, your experience may be different. It is recommended to use the latest version of VirtualBox to avoid issues. The VirtualBox forum is a good place to find a solution if you see any problems.

Go to VirtualBox website here to download the binary for your current operating system. Since our host machine is running on Windows, I’ll choose ‘x86/amd64’ from Windows hosts. When download is finished, run the executable file. Continue with the installation of VirtualBox with the defaults. This will open VirtualBox at the end of the installation.

Create Virtual Machine

Click ‘New’ button to open a dialog.

Type a name for the new virtual machine. Since I am planning to install Ubuntu 14.04, I’ll enter ‘ubuntu1404’. Note that VirtualBox automatically changes ‘Type’ to Linux and ‘Version’ to ‘Ubuntu (64 bit)’. These two options are exactly what we need.

The memory size depends on your host machine memory size. In my case, I have 12GB physical RAM. I like to allocate as much as possible for Ubuntu but leave some for my Windows host machine. I pick 8192 MB for my Ubuntu. Note that VirtualBox will create a swap partition with the same amount space as base memeory you have entered here. So later when you are selecting the size of the virtual hard drive, make sure it is large enough since the hard drive will be splitted into root (/)and swap partitions. The root partition contains by default all your system files, program settings and documents.

Accept the default ‘Create a virtual hard drive now’ and click ‘Create’ button.

Continue to accept the default ‘VDI’ drive file type and click ‘Next’ button.

Change the storage type from the default ‘Dynamically allocated’ to ‘Fixed size’ to increase performance.

For the virtual hard drive space, the default value is 8GB which is too little for RNA-Seq analysis. I’ll pick 100GB since I have plenty of space in my hard disk. You want to choose a good size for your RNA-Seq analysis. If you realize the drive space is not large enough, you’ll need to go over these steps again to create another virtual machine.

Click ‘Create’ button and VirtualBox will generate Ubuntu virtual machine.

Now the virtual machine is created. We are ready to install Ubuntu in this virtual machine. Select your new virtual machine and click ‘Settings’ button. Click on ‘Storage’ category and then ‘Empty’ under Controller:IDE. Click «CD/DVD» icon on right hand side and select the ubuntu ISO file to mount.

Note that if you have not downloaded 64-bit Ubuntu ISO file, you can check out this page for more information. When downloading Ubuntu ISO file, make sure to selecte 64-bit version. Also make sure the VT-x/Virtualization Technology has been enabled in your computer’s BIOS/Basic Input Output System.

Since Tophat program can take an advantage of multiple processors/threads, it is a good idea to specify a large number of processors in virtual machine (default value is 1). You can change this number by clicking on ‘System’ category. In this case, I change the number of CPUs to 4 since 4 is the largest value shown on the green bar in my case. Now you can click ‘OK’ button to continue.

VirtualBox may pop up a message about ‘Auto capture keyboard’ option. Read the message there and check ‘Do not show this message again’ option before clicking OK.

Install Ubuntu

Back to Oracle VM VirtualBox Manager, click on the new Ubuntu virtual machine and hit ‘Start’ button. Now you shall see a ‘Welcome’ screen. Click ‘Install Ubuntu’ button. Note that the installation process may differ a little bit from version to version. The screenshots here are based on Ubuntu 14.04.1.

Click ‘Continue’ button.

Make sure ‘Erase disk and install Ubuntu’ option is selected and click ‘Install Now’ button.

Ubuntu will ask you a few questions. If the default is good, click ‘Continue’ button.

In ‘Who are you?’ dialog, enter your preferred name, username and password. Note that this user will have root/sudo privilege. Click ‘Continue’ button.

The installation will continue until it is finished.

After installation is complete, click ‘Restart Now’ button. When you see a screen with a black background saying ‘Please remove installation media and close the tray (if any) then press ENTER:’, just follow it.

Enter the password you have chosen and press ‘Enter’.

The Ubuntu Desktop OS is ready. You may find the desktop screen is too small. Don’t worry. You can solve this easily with «VirtualBox Guest Additions».

More About VirtualBox

Guest Additions

After the Ubuntu guest machine is installed, you will find the Ubuntu OS screen size is not extendable and you are not able to share folders between the host machine and Ubuntu.

Guest Additions software provide additional capability to a guest virtual machine, including mouse pointer integration, better video support, share folders, share clipboard, et al.

Before we proceed to install Guest Additions, make sure the current user has sudo/root privilege. If the current user does not have sudo/root privilege or it is not sure, run the following terminal command from an account (such as the user created when Ubuntu was first created; see the screenshot of ‘Who are you?’ above) with root privileges to enable the root privilege for the current user where USERNAME should be replaced by the current user’s name.

To install Guest Additions, click Devices > Insert Guest Additions CD images…

Click ‘Run’ button (next to ‘Cancel’ button) to start the installation. Note that the version of VBOXADDITIONS should be matched with the one of VirtualBox you have installed.

Installing Guest Additions requires root privilege. Enter user’s password (assume the current user has sudo privilege).

When the installation is finished, press Return key to close the terminal window.

Now prepare to restart the system to enable the change. Click ‘Shutdown’ on the menu and then the ‘Restart’ button.

After rebooting Ubuntu, you will see the desktop resolution is much better.

Share Folders

Before you can enable shared folders on the host machine, make sure you have installed VirtualBox Guest Additions software on the guest machine.

When Ubuntu guest machine is on, click on Devices > Shared folders settings…

Select Machine Folders and hit the add button (plus sign).

Browse to the folder you wish to access from the guest machine. Check Auto-mount and Make Permanent options and click OK button.

Click OK button once more.

Now type ‘terminal’ in Dash to open a Terminal.

Type the following line in the Terminal to add a user to ‘vboxsf’ group. This step is necessary in order to use the VB’s ‘Shared Folder’ feature. Replace ‘brb’ with your account name in Ubuntu. When you are done, restart the Ubuntu guest machine and go to /media/ directory. From Nautilus (file manager in Ubuntu), click Computer > File System > Media folder and inside it you will see a folder beginning with sf_ (the folder name is sf_Downloads in our example). Now you can transfer files between the Ubuntu guest machine and the Windows host machine in Nautilus.

Although Shared Folder system in VirtualBox is a nice feature, using VirtualBox shared folder directly for fastq data, annotation or output directory can significantly reduce the performance compared to a native (Ubuntu) system or VirtualBox native system.

BRB-DGE

After Ubuntu has been successfully installed on VirtualBox, users can be go back to download and use BRB-DGE program.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *