PDA

Просмотр полной версии : Инсталляция VirtualBox в Ubuntu 11.10 server (console)


Marley
19.11.2011, 21:02
Инсталляция VirtualBox в Ubuntu 11.10 server (console)


// Получить роли суперпользователя
$ sudo su -

// Обновить систему
# apt-get -y upgrade

// Обновить заголовки репоизитория
# apt-get -y update

// Устанавливаю SSH
# apt-get install -y openssh-server

Marley
19.11.2011, 21:10
// Создаем группу администраторов виртуальных машин:
# groupadd -g 1005 vmadmins


// Создаем пользователя для работы с виртуальными машинами
# useradd -g vmadmins -d /home/vmadm -s /bin/bash -m vmadm

// Создадим пароль созданному пользователю
# passwd vmadm

echo 'vmadm ALL=(ALL) ALL' >> /etc/sudoers

# su - vmadm

$ cd /tmp/


$ wget http://download.virtualbox.org/virtualbox/4.1.6/virtualbox-4.1_4.1.6-74713~Ubuntu~oneiric_amd64.deb
$ wget http://download.virtualbox.org/virtualbox/4.1.6/Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack

$ chmod +x virtualbox-4.1_4.1.6-74713~Ubuntu~oneiric_amd64.deb


$ sudo dpkg -i virtualbox-4.1_4.1.6-74713~Ubuntu~oneiric_amd64.deb

$ sudo apt-get -f -y install

$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack

Marley
19.11.2011, 23:08
$ mkdir $HOME/machines
$ mkdir $HOME/backups

Marley
20.11.2011, 00:32
Появились ошибки:




WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (3.0.0-12-server) or it failed to
load. Please recompile the kernel module and install it by

sudo /etc/init.d/vboxdrv setup

You will not be able to start VMs until this problem is fixed.




[email protected]:~$ sudo /etc/init.d/vboxdrv setup



[sudo] password for vmadm:
* Stopping VirtualBox kernel modules [ OK ]
* Uninstalling old VirtualBox DKMS kernel modules [ OK ]
* Trying to register the VirtualBox kernel modules using DKMS
* Failed, trying without DKMS
* Recompiling VirtualBox kernel modules
* Look at /var/log/vbox-install.log to find out what went wrong






==================================

Помогло:

[email protected]:/tmp# sudo apt-get remove dkms



Reading package lists... Done
Building dependency tree
Reading state information... Done
Package dkms is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.




[email protected]:/tmp# sudo rm -rf /var/lib/dkms/vboxhost/


[email protected]:/tmp# sudo apt-get install dkms



Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
binutils cpp cpp-4.6 fakeroot gcc gcc-4.6 libc-dev-bin libc6-dev libgomp1 libmpc2 libmpfr4 libquadmath0
linux-libc-dev make manpages-dev
Suggested packages:
binutils-doc cpp-doc gcc-4.6-locales gcc-multilib autoconf automake1.9 libtool flex bison gdb gcc-doc
gcc-4.6-multilib libmudflap0-4.6-dev gcc-4.6-doc libgcc1-dbg libgomp1-dbg libquadmath0-dbg libmudflap0-dbg
binutils-gold glibc-doc make-doc
The following NEW packages will be installed:
binutils cpp cpp-4.6 dkms fakeroot gcc gcc-4.6 libc-dev-bin libc6-dev libgomp1 libmpc2 libmpfr4 libquadmath0
linux-libc-dev make manpages-dev
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.8 MB of archives.
After this operation, 60.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libgomp1 amd64 4.6.1-9ubuntu3 [25.4 kB]
Get:2 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libquadmath0 amd64 4.6.1-9ubuntu3 [126 kB]
Get:3 http://ru.archive.ubuntu.com/ubuntu/ oneiric-updates/main binutils amd64 2.21.53.20110810-0ubuntu5 [2,637 kB]
Get:4 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libmpfr4 amd64 3.0.1-5 [188 kB]
Get:5 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libmpc2 amd64 0.9-3 [39.5 kB]
Get:6 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main cpp-4.6 amd64 4.6.1-9ubuntu3 [4,816 kB]
Get:7 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main cpp amd64 4:4.6.1-2ubuntu5 [28.0 kB]
Get:8 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main gcc-4.6 amd64 4.6.1-9ubuntu3 [7,514 kB]
Get:9 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main gcc amd64 4:4.6.1-2ubuntu5 [5,110 B]
Get:10 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main make amd64 3.81-8.1ubuntu1 [118 kB]
Get:11 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main dkms all 2.2.0.2-1ubuntu4 [72.3 kB]
Get:12 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main fakeroot amd64 1.17-1 [107 kB]
Get:13 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libc-dev-bin amd64 2.13-20ubuntu5 [82.1 kB]
Get:14 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main linux-libc-dev amd64 3.0.0-12.20 [806 kB]
Get:15 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main libc6-dev amd64 2.13-20ubuntu5 [2,575 kB]
Get:16 http://ru.archive.ubuntu.com/ubuntu/ oneiric/main manpages-dev all 3.27-1ubuntu2 [1,627 kB]
Fetched 20.8 MB in 57s (359 kB/s)
Selecting previously deselected package libgomp1.
(Reading database ... 50368 files and directories currently installed.)
Unpacking libgomp1 (from .../libgomp1_4.6.1-9ubuntu3_amd64.deb) ...
Selecting previously deselected package libquadmath0.
Unpacking libquadmath0 (from .../libquadmath0_4.6.1-9ubuntu3_amd64.deb) ...
Selecting previously deselected package binutils.
Unpacking binutils (from .../binutils_2.21.53.20110810-0ubuntu5_amd64.deb) ...
Selecting previously deselected package libmpfr4.
Unpacking libmpfr4 (from .../libmpfr4_3.0.1-5_amd64.deb) ...
Selecting previously deselected package libmpc2.
Unpacking libmpc2 (from .../libmpc2_0.9-3_amd64.deb) ...
Selecting previously deselected package cpp-4.6.
Unpacking cpp-4.6 (from .../cpp-4.6_4.6.1-9ubuntu3_amd64.deb) ...
Selecting previously deselected package cpp.
Unpacking cpp (from .../cpp_4%3a4.6.1-2ubuntu5_amd64.deb) ...
Selecting previously deselected package gcc-4.6.
Unpacking gcc-4.6 (from .../gcc-4.6_4.6.1-9ubuntu3_amd64.deb) ...
Selecting previously deselected package gcc.
Unpacking gcc (from .../gcc_4%3a4.6.1-2ubuntu5_amd64.deb) ...
Selecting previously deselected package make.
Unpacking make (from .../make_3.81-8.1ubuntu1_amd64.deb) ...
Selecting previously deselected package dkms.
Unpacking dkms (from .../dkms_2.2.0.2-1ubuntu4_all.deb) ...
Selecting previously deselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.17-1_amd64.deb) ...
Selecting previously deselected package libc-dev-bin.
Unpacking libc-dev-bin (from .../libc-dev-bin_2.13-20ubuntu5_amd64.deb) ...
Selecting previously deselected package linux-libc-dev.
Unpacking linux-libc-dev (from .../linux-libc-dev_3.0.0-12.20_amd64.deb) ...
Selecting previously deselected package libc6-dev.
Unpacking libc6-dev (from .../libc6-dev_2.13-20ubuntu5_amd64.deb) ...
Selecting previously deselected package manpages-dev.
Unpacking manpages-dev (from .../manpages-dev_3.27-1ubuntu2_all.deb) ...
Processing triggers for man-db ...
Setting up libgomp1 (4.6.1-9ubuntu3) ...
Setting up libquadmath0 (4.6.1-9ubuntu3) ...
Setting up binutils (2.21.53.20110810-0ubuntu5) ...
Setting up libmpfr4 (3.0.1-5) ...
Setting up libmpc2 (0.9-3) ...
Setting up cpp-4.6 (4.6.1-9ubuntu3) ...
Setting up cpp (4:4.6.1-2ubuntu5) ...
Setting up gcc-4.6 (4.6.1-9ubuntu3) ...
Setting up gcc (4:4.6.1-2ubuntu5) ...
Setting up make (3.81-8.1ubuntu1) ...
Setting up dkms (2.2.0.2-1ubuntu4) ...
Setting up fakeroot (1.17-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode.
Setting up libc-dev-bin (2.13-20ubuntu5) ...
Setting up linux-libc-dev (3.0.0-12.20) ...
Setting up libc6-dev (2.13-20ubuntu5) ...
Setting up manpages-dev (3.27-1ubuntu2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
[email protected]:/tmp# sudo /etc/init.d/vboxdrv setup
* Stopping VirtualBox kernel modules [ OK ]
* Uninstalling old VirtualBox DKMS kernel modules [ OK ]
* Trying to register the VirtualBox kernel modules using DKMS [ OK ]
* Starting VirtualBox kernel modules [ OK ]

Marley
30.11.2011, 03:07
Настройка автозапуска виртуальных машин virtualbox в Ubuntu

Необходимо дополнитеьно протестировать...

VBoxTool
http://vboxtool.sourceforge.net/

cd /tmp

wget http://sourceforge.net/projects/vboxtool/files/vboxtool/0.4/vboxtool-0.4.zip

cd /tmp/scripts

cp vboxtool /usr/local/bin
chmod +x /usr/local/bin/vboxtool

cp vboxtoolinit /etc/init.d
chmod +x /etc/init.d/vboxtoolinit

update-rc.d vboxtoolinit defaults 99 10

mkdir -p /etc/vboxtool


Note. To remove vboxtoolinit from autostart: update-rc.d -f vboxtoolinit remove


// Получить список созданных виртуальных машин:
$ vboxmanage list vms
"vm_oel57_oradb112" {590ef069-9717-428b-98d8-90a8fecb67ef}
"vm_oel57_wls11" {ae864d80-d006-451e-9e58-46afa8f30c65}
"vm_xp_remote" {857ed18d-898a-4d55-a0c2-64fa9b43f463}


vi /etc/vboxtool/machines.conf



vm_xp_remote.3389
vm_oel57_wls11.3390
vm_oel57_oradb112.3391



vi /etc/vboxtool/vboxtool.conf


vbox_user='vmadm'



// Получить информацию о запущенных виртуальных машинах
$ vboxtool showrun
vm_oel57_oradb112: state=running vrdp= cpu=8% mem=1420m
vm_xp_remote: state=running vrdp= cpu=46% mem=938m







* Issue the following command:
vboxtool autostart

VBoxTool will configure sessions (VRDP-port). By now, session(s) should be up and
running and configured.

* Check if sessions or running, with the assumed vrdp-port:
vboxtool show

Show only the running sessions:
vboxtool showrun

* Check if sessions configured in /etc/vboxtool/machines.conf are be automatically
started at reboot. Reboot your system, check with: vboxtool showrun