Установка VirtualBox
Введение | |
Ubuntu из .deb | |
Ubuntu из репозирория | |
Узнать версию | |
GNUmakefile | |
Похожие статьи |
Введение
VirtualBox (Oracle VM VirtualBox) — программный продукт виртуализации для операционных систем Microsoft Windows , Linux , FreeBSD, macOS, Solaris/OpenSolaris, ReactOS, DOS и других.
Установка VirtualBox в Ubuntu
Скачайте .deb файл с официального сайта https://www.virtualbox.org/wiki/Linux_Downloads
Установите VirtualBox из .deb файла
dpkg -i virtualbox.deb
Если вам приходится делать это часто - есть смысл написать Makefile который будет это делать автоматически
.PHONY: download-virtualbox download-virtualbox: $(check_dir) @if [ ! -f $(DISTR_DIR)virtualbox.deb ]; then \ wget -r -np "https://download.virtualbox.org/virtualbox/6.1.28/" \ -A "virtualbox-6.1_6.1.28-*eoan_amd64.deb"; \ else \ echo "WARNING: virtualbox.deb already exists"; \ fi sudo mv ./download.virtualbox.org/virtualbox/6.1.28/* $(DISTR_DIR)virtualbox.deb @rm -rf download.virtualbox.org .PHONY: install-virtualbox install-virtualbox: sudo dpkg -i $(DISTR_DIR)virtualbox.deb
Подробнее про скачивание с помощью wget в Make файлах читайте здесь
Обратите внимание - название самого свежего на ноябрь 2021-го года дистрибутива VirtualBox соответствует 19-й версии Ubuntu, хотя уже в январе 2022-го мы ждём 21-ю Ubuntu (см. Releases )
Установка VirtualBox в Ubuntu
Из репозитория
sudo apt update
sudo apt -y install virtualbox virtualbox-ext-pack
Нажмите TAB чтобы выделить кнопку OK
Нажмите ENTER
Нажатием TAB выделите Yes
Нажмите ENTER
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi libgstreamer-plugins-bad1.0-0 libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libsdl-ttf2.0-0 libva-wayland2 python-is-python2 python2 python2-minimal python2.7 python2.7-minimal Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: build-essential dctrl-tools dkms dpkg-dev fakeroot g++ g++-9 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libfakeroot libgsoap-2.8.91 liblzf1 libstdc++-9-dev libvncserver1 virtualbox-dkms virtualbox-qt Suggested packages: debtags menu debian-keyring g++-multilib g++-9-multilib gcc-9-doc libstdc++-9-doc vde2 virtualbox-guest-additions-iso The following packages will be REMOVED: virtualbox-6.1 The following NEW packages will be installed: build-essential dctrl-tools dkms dpkg-dev fakeroot g++ g++-9 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libfakeroot libgsoap-2.8.91 liblzf1 libstdc++-9-dev libvncserver1 virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-qt 0 upgraded, 19 newly installed, 1 to remove and 0 not upgraded. Need to get 55.4 MB of archives. After this operation, 8,391 kB of additional disk space will be used. Get:1 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 dpkg-dev all 1.19.7ubuntu3 [679 kB] Get:2 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 libstdc++-9-dev amd64 9.3.0-17ubuntu1~20.04 [1,714 kB] Get:3 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 g++-9 amd64 9.3.0-17ubuntu1~20.04 [8,405 kB] Get:4 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 g++ amd64 4:9.3.0-1ubuntu2 [1,604 B] Get:5 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 build-essential amd64 12.8ubuntu1.1 [4,664 B] Get:6 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 dctrl-tools amd64 2.24-3 [61.5 kB] Get:7 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 dkms all 2.8.1-5ubuntu2 [66.8 kB] Get:8 http://fi.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 virtualbox-dkms amd64 6.1.26-dfsg-3~ubuntu1.20.04.2 [695 kB] Get:9 http://fi.archive.ubuntu.com/ubuntu focal/universe amd64 libgsoap-2.8.91 amd64 2.8.91-2 [231 kB] Get:10 http://fi.archive.ubuntu.com/ubuntu focal-updates/universe amd64 liblzf1 amd64 3.6-2~ubuntu1.20.04.2 [7,388 B] Get:11 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 libvncserver1 amd64 0.9.12+dfsg-9ubuntu0.3 [119 kB] Get:12 http://fi.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 virtualbox amd64 6.1.26-dfsg-3~ubuntu1.20.04.2 [21.5 MB] Get:13 http://fi.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 virtualbox-ext-pack all 6.1.26-2~ubuntu1.20.04.1 [10.6 kB] Get:14 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 libfakeroot amd64 1.24-1 [25.7 kB] Get:15 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 fakeroot amd64 1.24-1 [62.6 kB] Get:16 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-perl all 1.19.03-2 [46.6 kB] Get:17 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-xs-perl amd64 0.04-6 [11.3 kB] Get:18 http://fi.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-merge-perl all 0.08-3 [12.0 kB] Get:19 http://fi.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 virtualbox-qt amd64 6.1.26-dfsg-3~ubuntu1.20.04.2 [21.7 MB] Fetched 55.4 MB in 8s (7,184 kB/s) Preconfiguring packages ... (Reading database ... 197122 files and directories currently installed.) Removing virtualbox-6.1 (6.1.28-147628~Ubuntu~eoan) ... Selecting previously unselected package dpkg-dev. (Reading database ... 196370 files and directories currently installed.) Preparing to unpack .../00-dpkg-dev_1.19.7ubuntu3_all.deb ... Unpacking dpkg-dev (1.19.7ubuntu3) ... Selecting previously unselected package libstdc++-9-dev:amd64. Preparing to unpack .../01-libstdc++-9-dev_9.3.0-17ubuntu1~20.04_amd64.deb ... Unpacking libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ... Selecting previously unselected package g++-9. Preparing to unpack .../02-g++-9_9.3.0-17ubuntu1~20.04_amd64.deb ... Unpacking g++-9 (9.3.0-17ubuntu1~20.04) ... Selecting previously unselected package g++. Preparing to unpack .../03-g++_4%3a9.3.0-1ubuntu2_amd64.deb ... Unpacking g++ (4:9.3.0-1ubuntu2) ... Selecting previously unselected package build-essential. Preparing to unpack .../04-build-essential_12.8ubuntu1.1_amd64.deb ... Unpacking build-essential (12.8ubuntu1.1) ... Selecting previously unselected package dctrl-tools. Preparing to unpack .../05-dctrl-tools_2.24-3_amd64.deb ... Unpacking dctrl-tools (2.24-3) ... Selecting previously unselected package dkms. Preparing to unpack .../06-dkms_2.8.1-5ubuntu2_all.deb ... Unpacking dkms (2.8.1-5ubuntu2) ... Selecting previously unselected package virtualbox-dkms. Preparing to unpack .../07-virtualbox-dkms_6.1.26-dfsg-3~ubuntu1.20.04.2_amd64.deb ... Unpacking virtualbox-dkms (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Selecting previously unselected package libgsoap-2.8.91:amd64. Preparing to unpack .../08-libgsoap-2.8.91_2.8.91-2_amd64.deb ... Unpacking libgsoap-2.8.91:amd64 (2.8.91-2) ... Selecting previously unselected package liblzf1:amd64. Preparing to unpack .../09-liblzf1_3.6-2~ubuntu1.20.04.2_amd64.deb ... Unpacking liblzf1:amd64 (3.6-2~ubuntu1.20.04.2) ... Selecting previously unselected package libvncserver1:amd64. Preparing to unpack .../10-libvncserver1_0.9.12+dfsg-9ubuntu0.3_amd64.deb ... Unpacking libvncserver1:amd64 (0.9.12+dfsg-9ubuntu0.3) ... Selecting previously unselected package virtualbox. Preparing to unpack .../11-virtualbox_6.1.26-dfsg-3~ubuntu1.20.04.2_amd64.deb ... Unpacking virtualbox (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Selecting previously unselected package virtualbox-ext-pack. Preparing to unpack .../12-virtualbox-ext-pack_6.1.26-2~ubuntu1.20.04.1_all.deb ... License has already been accepted. Unpacking virtualbox-ext-pack (6.1.26-2~ubuntu1.20.04.1) ... Selecting previously unselected package libfakeroot:amd64. Preparing to unpack .../13-libfakeroot_1.24-1_amd64.deb ... Unpacking libfakeroot:amd64 (1.24-1) ... Selecting previously unselected package fakeroot. Preparing to unpack .../14-fakeroot_1.24-1_amd64.deb ... Unpacking fakeroot (1.24-1) ... Selecting previously unselected package libalgorithm-diff-perl. Preparing to unpack .../15-libalgorithm-diff-perl_1.19.03-2_all.deb ... Unpacking libalgorithm-diff-perl (1.19.03-2) ... Selecting previously unselected package libalgorithm-diff-xs-perl. Preparing to unpack .../16-libalgorithm-diff-xs-perl_0.04-6_amd64.deb ... Unpacking libalgorithm-diff-xs-perl (0.04-6) ... Selecting previously unselected package libalgorithm-merge-perl. Preparing to unpack .../17-libalgorithm-merge-perl_0.08-3_all.deb ... Unpacking libalgorithm-merge-perl (0.08-3) ... Selecting previously unselected package virtualbox-qt. Preparing to unpack .../18-virtualbox-qt_6.1.26-dfsg-3~ubuntu1.20.04.2_amd64.deb ... Unpacking virtualbox-qt (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Setting up libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ... Setting up libalgorithm-diff-perl (1.19.03-2) ... Setting up libvncserver1:amd64 (0.9.12+dfsg-9ubuntu0.3) ... Setting up libfakeroot:amd64 (1.24-1) ... Setting up dpkg-dev (1.19.7ubuntu3) ... Setting up fakeroot (1.24-1) ... update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode Setting up liblzf1:amd64 (3.6-2~ubuntu1.20.04.2) ... Setting up g++-9 (9.3.0-17ubuntu1~20.04) ... Setting up g++ (4:9.3.0-1ubuntu2) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode Setting up build-essential (12.8ubuntu1.1) ... Setting up libgsoap-2.8.91:amd64 (2.8.91-2) ... Setting up libalgorithm-diff-xs-perl (0.04-6) ... Setting up dctrl-tools (2.24-3) ... Setting up libalgorithm-merge-perl (0.08-3) ... Setting up dkms (2.8.1-5ubuntu2) ... Setting up virtualbox-dkms (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Loading new virtualbox-6.1.26 DKMS files... Building for 5.11.0-38-generic Building initial module for 5.11.0-38-generic Done. vboxdrv.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/5.11.0-38-generic/updates/dkms/ vboxnetadp.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/5.11.0-38-generic/updates/dkms/ vboxnetflt.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/5.11.0-38-generic/updates/dkms/ depmod... DKMS: install completed. Setting up virtualbox (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Setting up virtualbox-ext-pack (6.1.26-2~ubuntu1.20.04.1) ... virtualbox-ext-pack: downloading: https://download.virtualbox.org/virtualbox/6.1.26/Oracle_VM_VirtualBox_Extension_Pack-6.1.26.vbox-extpack The file will be downloaded into /usr/share/virtualbox-ext-pack License accepted. 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully installed "Oracle VM VirtualBox Extension Pack". Setting up virtualbox-qt (6.1.26-dfsg-3~ubuntu1.20.04.2) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... Processing triggers for systemd (245.4-4ubuntu3.13) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for shared-mime-info (1.15-1) ...
Узнать версию установленной VirtualBox
Чтобы определить версию VirtualBox выполните
virtualbox --help
Oracle VM VirtualBox VM Selector v6.1.26_Ubuntu (C) 2005-2021 Oracle Corporation All rights reserved. No special options. If you are looking for --startvm and related options, you need to use VirtualBoxVM.
Также можно воспользоваться VBoxManage
VBoxManage --version
6.1.26_Ubuntur145957
GNUmakefile
Скачать и установить VirtualBox с помощью make
DISTR_DIR=/home/$$(whoami)/Downloads/distr/ .PHONY: download-virtualbox download-virtualbox: $(check_dir) @if [ ! -f $(DISTR_DIR)virtualbox.deb ]; then \ wget -r -np "https://download.virtualbox.org/virtualbox/6.1.28/" \ -A "virtualbox-6.1_6.1.28-*eoan_amd64.deb"; \ else \ echo "WARNING: virtualbox.deb already exists"; \ fi sudo mv ./download.virtualbox.org/virtualbox/6.1.28/* $(DISTR_DIR)virtualbox.deb @rm -rf download.virtualbox.org .PHONY: install-virtualbox install-virtualbox: sudo dpkg -i $(DISTR_DIR)virtualbox.deb