# Устанвока и настрйока VirtualBox

Устанавливаем пакеты

```
aptitude install virtualbox-5.2 dkms
```

Если в процессе установки, будет ошибка

> This system is currently not set up to build kernel modules.
>
> Please install the Linux kernel "header" files matching the current kernel
>
> for adding new hardware support to the system.
>
> The distribution packages containing the headers are probably:
>
> ```
> linux-headers-amd64 linux-headers-3.2.0-4-amd64
> ```
>
> This system is currently not set up to build kernel modules.
>
> Please install the Linux kernel "header" files matching the current kernel
>
> for adding new hardware support to the system.
>
> The distribution packages containing the headers are probably:
>
> ```
> linux-headers-amd64 linux-headers-3.2.0-4-amd64
> ```
>
> There were problems setting up VirtualBox. To re-start the set-up process, run
>
> /sbin/vboxconfig as root.

Устанавливаю

```
aptitude install linux-headers-3.2.0-4-amd64
```

Выполняю

```
/sbin/vboxconfig
```

Теперь создадим юзера, под которым будут работать наши виртуальные машины и добавим его в группу vboxusers

Создаю файл /etc/default/virtualbox

Добавляю параметры

```
VBOXWEB_USER=vbox
VBOXWEB_TIMEOUT=0
VBOWWEB_LOGFILE=/var/log/vboxwebservice.log
VBOXWEB_HOST=192.168.0.2 # Указываем IP сервера, где распологается VirtualBox
VBOXWEB_PORT=18083
```

Создаю файл логов и даю ему права

```
touch vi /var/log/vboxwebservice.log
chown vbox:vboxuser /var/log/vboxwebservice.log
```

Заходим по [ссылке](http://download.virtualbox.org/virtualbox/) ищим Extension в соответсвии с нашей версии VirtualBox. Скачиваем и устанавливаем

```
#wget http://download.virtualbox.org/virtualbox/5.0.2/Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096.vbox-extpack

#VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096.vbox-extpack
```
