Virtualbox guest additions linux debian

Virtualbox guest additions linux debian

Since version 4.0 the name suffix OSE became obsolete. All non-GPL parts are now packed in an additional extension pack available from Oracle.

  1. Installing VirtualBox
    1. Debian Sid/Unstable
    2. Debian 12 «Bookworm»
    3. Debian 10 «Buster» and Debian 11 «Bullseye»
    4. Oracle Virtualbox third-party repository
    1. Debian Sid/Unstable
    2. Debian 12 «Bookworm»
    3. Debian 10 «Buster» and Debian 11 «Bullseye»
    1. Desktop
    2. Server
    1. The character device /dev/vboxdrv does not exist
    2. You are not a member of the «vboxusers» group
    3. Kernel driver not installed (rc=-1908)
    4. -1909 VERR VM DRIVER NOT ACCESSIBLE
    5. RDP not working out of the box?
    6. Loading VirtualBox kernel modules. modprobe vboxdrv failed
    1. Guest networking setup
    2. Switching consoles
    3. How to remotely start virtual machines using VNC

    Installing VirtualBox

    Debian Sid/Unstable

      Add the «contrib» and the «non-free» components to /etc/apt/sources.list, for example:

    # Debian Unstable "Sid" deb http://deb.debian.org/debian/ sid main contrib non-free
    sudo apt install virtualbox
    sudo apt install virtualbox-ext-pack

    Debian 12 «Bookworm»

    There are no packages, as of may 2023, for Debian Bookworm in the repositories. VirtualBox packages will arrive in Debian fasttrack after Debian 12 becomes the new stable release. In addition Oracle is waiting for the official release of Debian 12, before releasing a VirtualBox package: https://www.virtualbox.org/ticket/21524

    Debian 10 «Buster» and Debian 11 «Bullseye»

    Packages for VirtualBox are not officially available in stable releases of Debian, due to lack of cooperation from upstream on security support for older releases. See 794466

    1. Add the Fast Track repository by following the instructions at https://fasttrack.debian.net/
    2. Install the VirtualBox package with:
    sudo apt install virtualbox
    sudo apt install virtualbox-ext-pack

    Oracle Virtualbox third-party repository

    Oracle packages VirtualBox for a number of Linux distributions themselves, including Debian. These are completely unsupported by Debian, but you may find them interesting if you need a new version faster than Fast Track provides, or wish to stick close to upstream.

    See Oracle’s instructions on the VirtualBox Wiki.

    Installing the Guest Additions on a Debian VM

    This section documents installing the Guest Additions on a VirtualBox virtual machine with Debian, not a host system running VirtualBox.

    If you want the Guest Additions ISO for your host, see the virtualbox-guest-additions-iso package, which is available in the «non-free» archive area on all Debian versions.

    Debian Sid/Unstable

      Add the «contrib» and the «non-free» components to /etc/apt/sources.list, for example:

    # Debian Unstable "Sid" deb http://deb.debian.org/debian/ sid main contrib non-free
    sudo apt install virtualbox-guest-x11 virtualbox-guest-dkms

    Debian 12 «Bookworm»

    There are no packages, as of may 2023, for the Guest Additions for Debian Bookworm in the repositories. VirtualBox guest edition packages will arrive in Debian fasttrack after Debian 12 becomes the new stable release. For now, in order to install the prerequisites to build the Guest Additions from the VirtualBox Guest Additions ISO, follow these instructions:

    1. The appropriate kernel headers and build tools:

    sudo apt install build-essential dkms linux-headers-$(uname -r)

    2. Mount the Guest Additions ISO and copy VBoxLinuxAdditions.run from the ISO’s location to your home folder.

    3. Open a terminal and execute the following commands to install the guest additions:

    sudo chmod +x ./VBoxLinuxAdditions.run sudo ./VBoxLinuxAdditions.run

    4. Reboot the system and the VirtualBox Guest Additions should be installed!

    Debian 10 «Buster» and Debian 11 «Bullseye»

    Packages for VirtualBox’s Guest Additions are not officially available in stable releases of Debian, due to lack of cooperation from upstream on security support for older releases. See 794466

    1. Add the Fast Track repository by following the instructions at https://fasttrack.debian.net/
    2. Install the VirtualBox guest agent with:
    sudo apt install virtualbox-guest-x11
    sudo apt install virtualbox-guest-utils

    Starting

    Desktop

    • In KDE, go to: KDE menu > System > Oracle VM VirtualBox
    • In GNOME, go to: Activities > List Applications > all (super + A) > Oracle VM Virtualbox
    • In Mate, go to: Mate menu > Applications > System tools > Oracle VM VirtualBox
    • In Xfce, go to: Application > System tools > Oracle VM VirtualBox
    • In Xfce 4.16, go to: Applications > System > VirtualBox or to Applications > Accessories > VirtualBox
    • From an X terminal:
    $ virtualbox Or $ VirtualBox

    Server

    You can start VirtualBox in Headless mode using VBoxHeadless like this:

    $ VBoxHeadless -startvm "VMName"

    You should run this inside a screen instance and detach the screen after starting the VM with Ctrl+a d. At least in version 4.0.x you won’t need to use screen. Just start the vm with:

    $ VBoxManage startvm "VMName" --type headless

    and a VBoxSVC process appears in the background. You can loggoff without problems.

    Troubleshooting

    The character device /dev/vboxdrv does not exist

    WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-ose-modules package for your kernel and load the module named vboxdrv into your system. You will not be able to start VMs until this problem is fixed.

    If the module is not found, refer to Installation to provide a virtualbox-dkms* package to your system.

    You are not a member of the «vboxusers» group

    WARNING: You are not a member of the "vboxusers" group. Please add yourself to this group before starting VirtualBox. You will not be able to start VMs until this problem is fixed.
    $ su # adduser yourusername vboxusers

    Reboot your system to apply the group membership change.

    Kernel driver not installed (rc=-1908)

    The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing '/etc/init.d/vboxdrv setup' as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
    $sudo /etc/init.d/vboxdrv setup

    -1909 VERR VM DRIVER NOT ACCESSIBLE

    error-1909-VERR_VM_DRIVER_NOT_ACCESSIBLE.png

    RDP not working out of the box?

    To get RDP working you need to install the VirtualBox Extensions Pack from the vendors website VirtualBox Downloads.

    Simply download the extensions pack, click «File» => «Preferences» => «Extensions» => «Down arrow». Select the file you downloaded above. Click «OK». Restart VirtualBox.

    Loading VirtualBox kernel modules. modprobe vboxdrv failed

    Loading VirtualBox kernel modules. modprobe vboxdrv failed.
    Lockdown: modprobe: unsigned module loading is restricted

    It is because Secure Boot is enable, you have to sign yourself the kernel modules to be able to load them.

    See instructions to sign kernel modules with a Machine Owner Key at: https://wiki.debian.org/SecureBoot#MOK_-_Machine_Owner_Key

    You can also deactivate the secure boot in your bios.

    Tips & Tricks

    Guest networking setup

    When selecting virtualized hardware for the guest operating system, you have a number of choices, including Bridged network adapter, Generic network adapter, and Network Address Translations (NAT). The type you select is based on your requirements, but a good rule of thumb is:

    1) If the host has a wired ethernet adapter, then the guest can use a Bridged network. The bridge allows the guest to act like any other host on the network. The guest will have its own MAC address, obtain an IP address from the local DHCP server, access the internet through the gateway, etc.

    2) If the host has a wifi adapter, then the guest should use NAT network. This is the default for VirtualBox. The guest will obtain access the internet through an external network. The first network card is connected to the private network 10.0.2.0, the second network card is connected to the network 10.0.3.0 and so on.

    For details, see Chapter 6, Virtual Networking in the VirtualBox documentation.

    Switching consoles

    The normal way to switch consoles in Linux is to use the ctrl-alt-Fx key combination. This does not work for a VirtualBox virtual machine (VM); it will switch consoles for the host system instead.

    You should use -Fx instead, where is the key defined in File->Preferences->Input.

    This also works for ctrl-alt-del and ctrl-alt-backspace

    This is documented in the VirtualBox user manual in the section "Keyboard and mouse support in virtual machines", subsection "Typing special characters".

    (An alternative method to switch between text consoles is to use alt-left and alt-right, but that does not work for graphical consoles like XOrg or DirectFB.)

    How to remotely start virtual machines using VNC

    • log onto your remote box
    • install tightvncserver
    • launch it (you don't need a display), pick a password
    • determine which port it is using, a way to do so:
      • netstat -tap | grep vnc
      • Let's say it's 5901
      • install xtightvncviewer
      • create a ssh tunnel to your box:
        • ssh -L 5901:localhost:5901 you@remote
        • xtightvncviewer localhost::5901

        See Also

        • Alternative SystemVirtualization tools.
        • It is possible to use Veewee to automate the creation of Debian guests images for VirtualBox
        • http://www.virtualbox.org/ - VirtualBox OSE homepage;
          • http://www.virtualbox.org/wiki/User_FAQ - Frequently Asked Questions
          • http://www.virtualbox.org/manual/UserManual.html (PDF) - Official User Manual
          • #vbox - IRC channel
          • http://www.virtualbox.org/wiki/Linux_Downloads - Using upstream's binaries (repository).

          Источник

          Дополнения гостевой ос Virtualbox Debian

          Довольно часто мы используем операционные системы, установленные в виртуальную машину, это удобнее чем устанавливать новый дистрибутив на реальный компьютер, но в то же время имеет свои недостатки, например, невозможность скопировать файлы в гостевую систему, проблемы с разрешением экрана и так далее. Часть этих проблем может решить установка дополнений гостевой ос VirtualBox.

          Раньше мы рассматривали как устанавливаются эти дополнения в Ubuntu, сегодня же остановимся на Debian 9, самой новой версии дистрибутива доступной на данный момент. Я сталкивался с проблемой установки дополнений в этом дистрибутиве, но пользователи unix.stackexchange подсказали решение, и в сегодняшней статье я поделюсь им с вами.

          Зачем нужны дополнения гостевой ОС?

          Дополнения гостевой ос virtualbox debian делают работу с операционной системой намного удобнее, мало того, что повышается в разы производительность, так еще и появляются дополнительные функции такие как:

          • Общий буфер обмена;
          • Передача файлов перетаскиванием;
          • Интеграция экранов;
          • Автоматическая настройка разрешения экрана;
          • Поддержка 3D ускорения в системе и другие возможности, упрощающие работу.

          Таким образом, после установки дополнений вы почти не будете замечать что работаете в виртуальной машине. Гостевая debian virtualbox будет работать намного лучше.

          Установка дополнений гостевой ОС в Debian

          Первое что нам понадобится, это самая новая версия виртуальной машины VirtualBox 5.1.24 или 5.1.26. Если вы возьмете более старую версию, то не сможете установить дополнения, поскольку они несовместимы с новым ядром. Новую версию программы можно получить из PPA, только перед этим не забудьте полностью удалить старую, с вашими машинами при этом ничего не случится.

          Теперь выполняем действия уже в гостевой системе. Сначала устанавливаем заголовки ядра и пакеты, необходимые для сборки:

          apt install linux-headers-4.9.0-3-amd64 build-essential dkms

          Затем подключите образ virtualbox additions debian ОС через меню виртуальной машины:

          В Debian, по умолчанию образы дисков монтируются с флагом noexec, так что вы не сможете запустить из него программу, поэтому такой диск нужно перемонтировать. Допустим, система примонтировала образ в /media/cdrom0:

          sudo mount -o remount,exec,ro /media/cdrom0

          И только теперь запускам установку дополнений:

          Если все было сделано правильно, то дополнения гостевой ос virtualbox debian будут установлены, но это займет некоторое время, поскольку утилите нужно собрать модули ядра из исходников. Для полного завершения настройки перезагрузите виртуальную машину и можете наслаждаться ее работой.

          Выводы

          В этой небольшой статье мы рассмотрели как установить virtualbox guest additions debian, как видите, это очень просто, и что самое главное, они сильно упрощают работу. Если у вас остались вопросы, спрашивайте в комментариях!

          Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

          Источник

          Читайте также:  Cat command use in linux
Оцените статью
Adblock
detector