- How to Install VirtualBox on Ubuntu [Beginner’s Tutorial]
- Installing VirtualBox on Ubuntu and Debian-based Linux distributions
- Method 1: Install VirtualBox from Ubuntu Repository
- Method 2: Install VirtualBox using deb file from Oracle’s website
- Method 3: Install VirtualBox using Oracle’s repository
- How to remove VirtualBox from Ubuntu
- VirtualBox на Linux — подробный обзор и инструкция
- VirtualBox 6.0
- Установка VirtualBox
- Официальный сайт
- Менеджер приложений
- Командная строка
- Видео
- Вывод
- Using virtualbox on linux
- 2.3.2.В The Oracle VM VirtualBox Kernel Modules
- 2.3.2.1.В Kernel Modules and UEFI Secure Boot
- 2.3.3.В Performing the Installation
- 2.3.3.1.В Installing Oracle VM VirtualBox from a Debian or Ubuntu Package
- 2.3.3.2.В Using the Alternative Generic Installer (VirtualBox.run)
- 2.3.3.3.В Performing a Manual Installation
- 2.3.3.4.В Updating and Uninstalling Oracle VM VirtualBox
- 2.3.3.5.В Automatic Installation of Debian Packages
- 2.3.3.6.В Automatic Installation of RPM Packages
- 2.3.3.7.В Automatic Installation Options
- 2.3.4.В The vboxusers Group
- 2.3.5.В Starting Oracle VM VirtualBox on Linux
How to Install VirtualBox on Ubuntu [Beginner’s Tutorial]
Last updated October 29, 2020 By Abhishek Prakash 50 Comments
This beginner’s tutorial explains various ways to install VirtualBox on Ubuntu and other Debian-based Linux distributions.
Oracle’s free and open-source offering VirtualBox is an excellent virtualization tool, especially for desktop operating systems. I prefer using it over VMWare Workstation in Linux, another virtualization tool.
You can use virtualization software like VirtualBox for installing and using another operating system within a virtual machine.
You can also use VirtualBox for installing another Linux distribution within your current Linux system. Actually, this is what I use it for. If I hear about a nice Linux distribution, instead of installing it on a real system, I test it on a virtual machine. It’s more convenient when you just want to try out a distribution before making a decision about installing it on your actual computer.
In this beginner’s tutorial, I’ll show you various ways of installing Oracle VirtualBox on Ubuntu and other Debian-based distributions.
Installing VirtualBox on Ubuntu and Debian-based Linux distributions
The installation methods mentioned here should also work for other Debian- and Ubuntu-based Linux distributions such as Linux Mint, elementary OS, etc.
Method 1: Install VirtualBox from Ubuntu Repository
Pros: Easy installation
Cons: Installs older version
The easiest way to install VirtualBox on Ubuntu is to search for it in the Software Center and install it from there.
VirtualBox is available in the Ubuntu Software Center
You can also install it from the command line using this command:
However, if you check the package version before installing it, you’ll see that the VirtualBox provided by Ubuntu’s repository is quite old.
For example, the current VirtualBox version at the time of writing is 6.0, but the one in Software Center is 5.2. This means you won’t get the newer features introduced in the latest version of VirtualBox.
Method 2: Install VirtualBox using deb file from Oracle’s website
Pros: Easily install the latest version
Cons: Can’t upgrade to newer version
If you want to use the latest version of VirtualBox on Ubuntu, the easiest way would be to use the deb file.
Oracle provides ready-to-use binary files for VirtualBox releases. If you look at its download page, you’ll see the option to download the deb installer files for Ubuntu and other distributions.
You just have to download this deb file and double click on it to install it. It’s as simple as that.
However, the problem with this method is that you won’t get automatically updated to newer VirtualBox releases. The only way is to remove the existing version, download the newer version and install it again. That’s not very convenient, is it?
Method 3: Install VirtualBox using Oracle’s repository
Pros: Automatically updates with system updates
Cons: Slightly complicated installation
This is the command line method, and it may seem complicated to you, but it has advantages over the previous two methods. You’ll get the latest version of VirtualBox, which will be automatically updated with future releases. That’s what you’re looking for, I presume.
To install VirtualBox using the command line, you add Oracle VirtualBox’s repository to your list of repositories. You then add its GPG key so that your system trusts this repository. Now when you install VirtualBox, it will be installed from Oracle’s repository instead of Ubuntu’s repository. If a new version is released, the VirtualBox install will be updated along with the system updates. Let’s see how to do that.
First, add the key for the repository. You can download and add the key using this single command.
Important for Mint users
The next step will work for Ubuntu only. If you’re using Linux Mint or some other distribution based on Ubuntu, replace $(lsb_release -cs) in the command with the Ubuntu version your current version is based on. For example, Linux Mint 19 series users should use bionic and Mint 18 series users should use xenial. Something like this:
sudo add-apt-repository “deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib “
Now add the Oracle VirtualBox repository to the list of repositories using this command:
If you’ve read my article on checking your Ubuntu version, you probably know that ‘lsb_release -cs’ will print the codename of your Ubuntu system.
Note: If you see an add-apt-repository command not found error, you’ll have to install the software-properties-common package.
Now that you have the correct repository added, refresh the list of packages available through these repositories and install VirtualBox.
Tip: A good idea would be to type sudo apt install virtualbox – and hit tab to see the various VirtualBox versions available for installation – then select one of them by typing it completely.
How to remove VirtualBox from Ubuntu
Now that you’ve learned to install VirtualBox, I should also mention the steps for removing it.
If you installed it from the Software Center, the easiest way to remove the application is from the Software Center itself. You just have to find it in the list of installed applications and click the Remove button.
Another ways is to use the command line.
Note that this will not remove the virtual machines and the files associated with the operating systems you installed using VirtualBox. That’s not an entirely bad thing, because you may want to keep them safe and use them later or in some other system.
Finally …
I hope you were able to use one of these methods to install VirtualBox. I’d also advise installing VirtualBox Guest Additions on Ubuntu or whatever guest system you’re using in your VM to get a better and smoother experience.
I’ll also write about using it effectively in another article. For the moment, if you have any tips, suggestions or questions, feel free to leave a comment below.
Like what you read? Please share it with others.
Источник
VirtualBox на Linux — подробный обзор и инструкция
Бесплатное программное обеспечение Oracle с открытым исходным кодом VirtualBox является отличным инструментом виртуализации. Вариантов использования ПО великое множество.
Например, вы можете установить Linux на VirtualBox внутри Windows . Точно так же можете установить Windows внутри Linux, используя инструмент .
Кроме того, используйте VirtualBox для установки другого дистрибутива Linux в текущей системе Linux.
VirtualBox (VB) — это программное обеспечение для виртуализации, разработанное корпорацией Oracle. По сути, VB позволяет пользователю запускать гостевую ОС на другой ОС хоста. При этом, практически без необходимости разметки жесткого диска или запуска другой ОС при двойной загрузке.
На самом деле Виртуалбокс создает виртуальный жесткий диск и устанавливает на него «гостевую» ОС. Виртуальный жесткий диск — это не что иное, как файл большого размера, хранящийся на жестком диске компьютера. Этот файл работает как настоящий жесткий диск для «гостевой» ОС.
Запуск любого прикладного ПО или видеоигры на виртуальных машинах иногда не так гладок, как запуск на ОС, установленной на полном оборудовании. Все зависит от объема ресурса, выделенного виртуальной машине.
Многие слышали о VB, но есть причины, которые останавливают желание его использовать. Причина в том, что установка виртуальной машины — может нанести вред всей нашей компьютерной системе. Но это ошибочное мнение. Во-первых, настройка виртуальных машин — это элементарная задача. Во-вторых, она не повлияет на компьютерную систему, если настроить правильно.
Для каких пользователей инструмент подходит больше всего:
- Пользователи, которые связываются с различными прикладными программами и ОС.
- Разработчики, которые тестируют приложение на разных платформах, прежде чем выпускать для широкой публики.
- Рецензенты ПО, также используют это для тестирования на платформах в одном окне.
VirtualBox 6.0
Oracle выпустила VirtualBox версии 6.0.0. Данная версия работает на Linux, Windows, Macintosh а также Solaris.
Виртуалбокс получает частые обновления и выпуски. Релиз v. 6.0 — основной, поскольку содержит ряд важных обновлений.
Этот выпуск поставляется с улучшениями в HiDPI и поддержкой ядра Linux 4.20.
Первое, что бросается в глаза, это понятный пользовательский интерфейс.
Интерфейс обновлен, и теперь получайте доступ к информации, такой как снимки, журналы, диски.
Кроме того, можно использовать диспетчер файлов для работающей виртуальной машины из Меню-> Машина-> Диспетчер файлов. Этот файловый менеджер копирует и передает файлы между хост и гостевой системой.
Основные новые функции в VirtualBox 6.0
- Значительно улучшена поддержка HiDPI и масштабирования. Пользовательский интерфейс более прост в использовании. В итоге, лучше обнаруживает дисплей и упрощает настройку виртуальных машин.
- VirtualBox 6.0.0 поставляется с поддержкой экспорта виртуальных машин в Oracle Cloud Infrastructure.
- Для гостей Windows предусмотрена поддержка 3D-графики, а в качестве эмуляции для гостей Solaris и Linux используется эмуляция 3D-устройства VMSVGA.
- Поддерживает настройку динамиков объемного звучания, которая используется в Windows 10 Build 1809.
- vboxing-монтирование утилиты для хостов, которая позволяет пользователям получать доступ к содержимому гостевых дисков на хосте.
- Дополнительная поддержка Hyper-V на хосте Windows для повышения производительности.
- Одно из основных изменений VB 6.0.0 — это поддержка ядра Linux 4.20, которое еще не выпущено.
- VirtualBox 6.0.0 имеет улучшенную запись аудио и видео, которая теперь включается отдельно.
- Другие улучшения и исправления включают в себя эмуляцию последовательного порта, исправления установщика для Solaris, улучшения производительности в общих папках, исправления BIOS.
О аналогичной программе можно узнать здесь.
Установка VirtualBox
Официальный сайт
- Переходим по данной ссылке. И выбираем подходящую для вас версию.
- После того как .deb файл будет скачан, включаем его и нажимаем установить.
Менеджер приложений
Важно! Данным способом можно установить лишь VirtualBox 5 версии.
Заходим в менеджер приложений и в поиск вводим VirtualBox. После установки нажать на кнопку запустить.
Командная строка
- Вводим wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add —
- sudo add-apt-repository «deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib»
- sudo apt update && sudo apt install virtualbox-6.0
Видео
Вывод
В целом, VirtualBox 6.0 — это долгожданное и крайне необходимое улучшение по сравнению с предыдущей версией. С добавлением нового инструмента файлового менеджера и другими новыми функциями, блестящий пользовательский интерфейс завершает одно из самых ярких обновлений, которое когда-либо имел менеджер виртуальных машин.
В данной статье мы показали несколько методов установки VM. Какой вариант подходит — выбирать Вам. Все интересующие вопросы оставляйте в комментариях.
Источник
Using virtualbox on linux
For the various versions of Linux that are supported as host operating systems, see Section 1.4, “Supported Host Operating Systems”.
You may need to install the following packages on your Linux system before starting the installation. Some systems will do this for you automatically when you install Oracle VM VirtualBox.
Qt 5.3.2 or later. Qt 5.6.2 or later is recommended.
SDL 1.2.7 or later. This graphics library is typically called libsdl or similar.
These packages are only required if you want to run the Oracle VM VirtualBox graphical user interfaces. In particular, VirtualBox , the graphical VirtualBox Manager, requires both Qt and SDL. If you only want to run VBoxHeadless , neither Qt nor SDL are required.
2.3.2.В The Oracle VM VirtualBox Kernel Modules
In order to run other operating systems in virtual machines alongside your main operating system, Oracle VM VirtualBox needs to integrate very tightly with your system. To do this it installs a driver module called vboxdrv into the system kernel. The kernel is the part of the operating system which controls your processor and physical hardware. Without this kernel module, you can still use the VirtualBox Manager to configure virtual machines, but they will not start.
Network drivers called vboxnetflt and vboxnetadp are also installed. They enable virtual machines to make more use of your computer’s network capabilities and are needed for any virtual machine networking beyond the basic NAT mode.
Since distributing driver modules separately from the kernel is not something which Linux supports well, the Oracle VM VirtualBox install process creates the modules on the system where they will be used. This means that you may need to install some software packages from the distribution which are needed for the build process. Required packages may include the following:
GNU compiler (GCC)
Kernel header files
Also ensure that all system updates have been installed and that your system is running the most up-to-date kernel for the distribution.
The running kernel and the kernel header files must be updated to matching versions.
The following list includes some details of the required files for some common distributions. Start by finding the version name of your kernel, using the command uname -r in a terminal. The list assumes that you have not changed too much from the original installation, in particular that you have not installed a different kernel type.
With Debian and Ubuntu-based distributions, you must install the correct version of the linux-headers , usually whichever of linux-headers-generic , linux-headers-amd64 , linux-headers-i686 or linux-headers-i686-pae best matches the kernel version name. Also, the linux-kbuild package if it exists. Basic Ubuntu releases should have the correct packages installed by default.
On Fedora, Red Hat, Oracle Linux and many other RPM-based systems, the kernel version sometimes has a code of letters or a word close to the end of the version name. For example «uek» for the Oracle Unbreakable Enterprise Kernel or «default» or «desktop» for the standard kernels. In this case, the package name is kernel-uek-devel or equivalent. If there is no such code, it is usually kernel-devel .
On some SUSE and openSUSE Linux versions, you may need to install the kernel-source and kernel-syms packages.
If you suspect that something has gone wrong with module installation, check that your system is set up as described above and try running the following command, as root:
2.3.2.1.В Kernel Modules and UEFI Secure Boot
If you are running on a system using UEFI (Unified Extensible Firmware Interface) Secure Boot, you may need to sign the following kernel modules before you can load them:
vboxdrv
vboxnetadp
vboxnetflt
vboxpci
See your system documentation for details of the kernel module signing process.
2.3.3.В Performing the Installation
Oracle VM VirtualBox is available in a number of package formats native to various common Linux distributions. See Section 1.4, “Supported Host Operating Systems”. In addition, there is an alternative generic installer (.run) which you can use on supported Linux distributions.
2.3.3.1.В Installing Oracle VM VirtualBox from a Debian or Ubuntu Package
Download the appropriate package for your distribution. The following example assumes that you are installing to a 64-bit Ubuntu Xenial system. Use dpkg to install the Debian package,as follows:
The installer will also try to build kernel modules suitable for the current running kernel. If the build process is not successful you will be shown a warning and the package will be left unconfigured. Look at /var/log/vbox-install.log to find out why the compilation failed. You may have to install the appropriate Linux kernel headers, see Section 2.3.2, “The Oracle VM VirtualBox Kernel Modules”. After correcting any problems, run the following command:
This will start a second attempt to build the module.
If a suitable kernel module was found in the package or the module was successfully built, the installation script will attempt to load that module. If this fails, please see Linux Kernel Module Refuses to Load for further information.
Once Oracle VM VirtualBox has been successfully installed and configured, you can start it by clicking VirtualBox in your Start menu or from the command line. See Section 2.3.5, “Starting Oracle VM VirtualBox on Linux”.
2.3.3.2.В Using the Alternative Generic Installer (VirtualBox.run)
The alternative generic installer performs the following steps:
Unpacks the application files to the target directory /opt/VirtualBox/ , which cannot be changed.
Builds and installs the Oracle VM VirtualBox kernel modules: vboxdrv , vboxnetflt , and vboxnetadp .
Creates /sbin/rcvboxdrv , an init script to start the Oracle VM VirtualBox kernel module.
Creates a new system group called vboxusers .
Creates symbolic links in /usr/bin to a shell script /opt/VirtualBox/VBox which does some sanity checks and dispatches to the actual executables: VirtualBox , VBoxVRDP , VBoxHeadless and VBoxManage .
Creates /etc/udev/rules.d/60-vboxdrv.rules , a description file for udev, if that is present, which makes the USB devices accessible to all users in the vboxusers group.
Writes the installation directory to /etc/vbox/vbox.cfg .
The installer must be executed as root with either install or uninstall as the first parameter. For example:
Or if you do not have the sudo command available, run the following as root instead:
Add every user who needs to access USB devices from a VirtualBox guests to the group vboxusers . Either use the OS user management tools or run the following command as root:
The usermod command of some older Linux distributions does not support the -a option, which adds the user to the given group without affecting membership of other groups. In this case, find out the current group memberships with the groups command and add all these groups in a comma-separated list to the command line after the -G option. For example: usermod -G group1 , group2 ,vboxusers username .
2.3.3.3.В Performing a Manual Installation
If you cannot use the shell script installer described in Section 2.3.3.2, “Using the Alternative Generic Installer (VirtualBox.run)”, you can perform a manual installation. Run the installer as follows:
This will unpack all the files needed for installation in the directory install under the current directory. The Oracle VM VirtualBox application files are contained in VirtualBox.tar.bz2 which you can unpack to any directory on your system. For example:
To run the same example as root, use the following commands:
The sources for Oracle VM VirtualBox’s kernel module are provided in the src directory. To build the module, change to the directory and use the following command:
If everything builds correctly, run the following command to install the module to the appropriate module directory:
In case you do not have sudo, switch the user account to root and run the following command:
The Oracle VM VirtualBox kernel module needs a device node to operate. The above make command will tell you how to create the device node, depending on your Linux system. The procedure is slightly different for a classical Linux setup with a /dev directory, a system with the now deprecated devfs and a modern Linux system with udev .
On certain Linux distributions, you might experience difficulties building the module. You will have to analyze the error messages from the build system to diagnose the cause of the problems. In general, make sure that the correct Linux kernel sources are used for the build process.
Note that the /dev/vboxdrv kernel module device node must be owned by root:root and must be read/writable only for the user.
Next, you install the system initialization script for the kernel module and activate the initialization script using the right method for your distribution, as follows:
This example assumes you installed Oracle VM VirtualBox to the /opt/VirtualBox directory.
Create a configuration file for Oracle VM VirtualBox, as follows:
Create the following symbolic links:
2.3.3.4.В Updating and Uninstalling Oracle VM VirtualBox
Before updating or uninstalling Oracle VM VirtualBox, you must terminate any virtual machines which are currently running and exit the Oracle VM VirtualBox or VBoxSVC applications. To update Oracle VM VirtualBox, simply run the installer of the updated version. To uninstall Oracle VM VirtualBox, run the installer as follows:
As root, you can use the following command:
You can uninstall the .run package as follows:
To manually uninstall Oracle VM VirtualBox, perform the manual installation steps in reverse order.
2.3.3.5.В Automatic Installation of Debian Packages
The Debian packages will request some user feedback when installed for the first time. The debconf system is used to perform this task. To prevent any user interaction during installation, default values can be defined. A file vboxconf can contain the following debconf settings:
The first line enables compilation of the vboxdrv kernel module if no module was found for the current kernel. The second line enables the package to delete any old vboxdrv kernel modules compiled by previous installations.
These default settings can be applied prior to the installation of the Oracle VM VirtualBox Debian package, as follows:
In addition there are some common configuration options that can be set prior to the installation. See Section 2.3.3.7, “Automatic Installation Options”.
2.3.3.6.В Automatic Installation of RPM Packages
The RPM format does not provide a configuration system comparable to the debconf system. See Section 2.3.3.7, “Automatic Installation Options” for how to set some common installation options provided by Oracle VM VirtualBox.
2.3.3.7.В Automatic Installation Options
To configure the installation process for .deb and .rpm packages, you can create a response file named /etc/default/virtualbox . The automatic generation of the udev rule can be prevented with the following setting:
The creation of the group vboxusers can be prevented as follows:
If the following line is specified, the package installer will not try to build the vboxdrv kernel module if no module fitting the current kernel was found.
2.3.4.В The vboxusers Group
The Linux installers create the system user group vboxusers during installation. Any system user who is going to use USB devices from Oracle VM VirtualBox guests must be a member of that group. A user can be made a member of the group vboxusers either by using the desktop user and group tools, or with the following command:
2.3.5.В Starting Oracle VM VirtualBox on Linux
The easiest way to start an Oracle VM VirtualBox program is by running the program of your choice ( VirtualBox , VBoxManage , or VBoxHeadless ) from a terminal. These are symbolic links to VBox.sh that start the required program for you.
The following detailed instructions should only be of interest if you wish to execute Oracle VM VirtualBox without installing it first. You should start by compiling the vboxdrv kernel module and inserting it into the Linux kernel. Oracle VM VirtualBox consists of a service daemon, VBoxSVC , and several application programs. The daemon is automatically started if necessary. All Oracle VM VirtualBox applications will communicate with the daemon through UNIX local domain sockets. There can be multiple daemon instances under different user accounts and applications can only communicate with the daemon running under the user account as the application. The local domain socket resides in a subdirectory of your system’s directory for temporary files called .vbox- -ipc . In case of communication problems or server startup problems, you may try to remove this directory.
All Oracle VM VirtualBox applications ( VirtualBox , VBoxManage , and VBoxHeadless ) require the Oracle VM VirtualBox directory to be in the library path, as follows:
Copyright В© 2004, 2020 Oracle and/or its affiliates. All rights reserved. Legal Notices
Источник