【Ubuntu server】VirtualBOXでVirtualBox Guest Additionsをインストール

 $sudo apt-get install virtualbox-guest-x11

で入る。

 

以下、こんなことやらなくてもよかったかも・・・

 

 1.VirtualBox Guest Additionsをマウントさせる

インストール方法は軽く以下に書いたけど、途中から異なる。

 メニューから選択するまでは一緒だが、そのままではマウントされなかったので、以下のような手順を設ける。

 

①デバイスの確認

$ sudo blkid

 

/dev/sr0: LABEL="VBOXADDITIONS_4.3.12_93733" TYPE="iso9660"
/dev/sda1: UUID="9de0f7b9-4704-46b9-8db2-5fa66febbf44" TYPE="ext2"
/dev/sda5: UUID="j6PdLb-5Bjf-qMct-YJ03-bn0n-CmkU-l5OJ65" TYPE="LVM2_member"
/dev/mapper/ubuntu--vg-root: UUID="2aea820d-9c1c-4aa7-9e05-11337584cbe2" TYPE="ext4"
/dev/mapper/ubuntu--vg-swap_1: UUID="229f92bc-d95d-4d81-b9d8-92af139eca72" TYPE="swap"

 blkidコマンドを利用するとデバイスの一覧が表示できる。

 

②マウント作業

Guest Additionsは「/dev/sr0」で認識されているので、これをマウントしてあげればいい。

$sudo mkdir /mnt/xxxx ←マウント先のフォルダを作成

$sudo mount -r /dev/sr0 /mnt/xxxx  ←マウント!

 これでマウントされるので、確認してみると

$ ls /mnt/xxxx


32Bit        VBoxLinuxAdditions.run          VBoxWindowsAdditions.exe
64Bit        VBoxSolarisAdditions.pkg        autorun.sh
AUTORUN.INF  VBoxWindowsAdditions-amd64.exe  cert
OS2          VBoxWindowsAdditions-x86.exe    runasroot.sh 

 

なお、マウントを外す場合は

$sudo umount /mnt/xxxx

 

2.VirtualBox Guest Additionsをインストール

後は以下のように実行すればOK

$ sudo /mnt/xxxx/VBoxLinuxAdditions.run

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.12 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The make utility was not found. If the following module compilation fails then
this could be the reason and you should try installing it.

The gcc utility was not found. If the following module compilation fails then
this could be the reason and you should try installing it.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.