Showing posts with label VirtualBox. Show all posts
Showing posts with label VirtualBox. Show all posts

Saturday, May 9, 2015

Ubuntu 14.04.01中安装Virtualbox guest addition

 转载请注明作者:KiwenLau,以及原文地址:

PS: 红色部分为命令

1. 更新源
sudo apt-get update

2. 更新已安装的包
sudo apt-get -y upgrade

3. 安装所需的软件
sudo apt-get install -y build-essential module-assistant

4. 为编译安装驱动模块安装必须的各种软件包
sudo m-a prepare

5. 开启ubuntu虚拟机, 插入guest additionCD
Devices > Insert Guest Additions CD image...

6. 挂载CD
sudo mount /dev/cdrom /media/cdrom

7. 安装guest addtion
sudo /media/cdrom/VBoxLinuxAdditions.run

8. 运行结果
# sudo /media/cdrom/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.26 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 headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...done.
Building the shared folder support module ...done.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.

运行结果含” Building the main Guest Additions module ...done”以及” Starting the VirtualBox Guest Additions ...done”表示安装成功

9. 可以用以下方法验证安装成功:
# lsmod | grep -io vboxguest
vboxguest
# modinfo vboxguest
filename:       /lib/modules/3.13.0-32-generic/misc/vboxguest.ko
version:        4.3.26
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     3D54FF6D3C1923680BE85CB
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:       
vermagic:       3.13.0-32-generic SMP mod_unload modversions
# lsmod | grep -io vboxguest | xargs modinfo | grep -iw version

version:        4.3.26

参考:

Saturday, January 17, 2015

设置Mac与Virtualbox中的Ubuntu的共享文件夹


转载请注明作者:KiwenLau,以及原文地址:


1.     开启ubuntu虚拟机,安装Guest Additions

Devices > Insert Guest Additions CD image...

挂载
sudo mount /dev/cdrom /media/cdrom

安装
sudo /media/cdrom/VBoxLinuxAdditions.run


2.     开启ubuntu虚拟机,设置共享文件夹

先在mac中创建共享文件夹ubuntu

Devices>Shared Fold settings>+>选中文件夹ubuntu>
选中Auto-mountMake Permanent


3.     关闭ubuntu虚拟机,在mac中修改共享文件夹权限。否则将无法创建软链接。
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

VM_NAME是虚拟机的名称
SHARE_NAME是共享文件夹名字


4.     创建自动挂载的共享文件夹的软链接

共享文件夹位于/media目录内以sf_ 为前缀

ln -s /media/sf_ubuntu mac


5.     虚拟机中挂载文件夹ubuntu (每次重启需要挂载一次,该方法不建议使用

创建文件夹mac
mkdir mac

挂载ubuntu文件夹到mac文件夹

mount -t vboxsf ubuntu mac