环境:
主机XP
虚拟机 Sun virtualbox + Ubuntu
一.虚拟机ubuntu的全屏显示
1、加载VBox的Guest Additions
2、运行一个终端
3、执行su - 更改到root用户 (如果更改失败,先激活root用户)
4、编辑/etc/X11/xorg.conf ,增加红色字段
Section "Device"
Identifier "Configured Video Device"
Driver "vboxvideo"
EndSection
5、进入/media/cdrom0(根据你具体情况有可能不同)
6、运行autorun.sh或者VBoxLinuxAdditions-x86.run或者VBoxLinuxAdditions-amd64.run(根据你的CPU类型选择)
7、重启
二.虚拟机Ubuntu与主机XP间的数据共享
前提是VboxGuestAddtions已经被安装。
1.在虚拟机中 设置 分配数据空间 ,
采用固定分配的方式,指定XP下需要共享的目录。
数据空间的名称在后面的步骤中要用到。
2.在Ubuntu terminal下运行
sudo mount -t vboxsf namedataspace(这个参数是分配好的数据空间的名称) /mnt/share(这个是挂载到的目录)
-t 后面指示的是文件系统的类型。
“For most types all the mount program has to do is issue a simple mount(2) system call, and no detailed knowledge of the filesys﹖em type is required. For a few types however (like nfs, nfs4,cifs, smbfs, ncpfs) ad hoc code is necessary. The nfs, nfs4,cifs, smbfs, and ncpfs have a separate mount program. In order to make it possible to treat all types in a uniform way, mount will execute the program /sbin/mount.TYPE (if that exists) whencalled with type TYPE.”
在安装VboxGuestAddtions之后,/usr/lib/VBoxGuestAdditions目录下有个mount.vboxsf可执行程序。被引用到了/sbin/mount.vboxsf.
若运行无误,说明挂载成功,进行/mnt/share下可以看到xp中的所需共享的数据。
此命令运行成功的前提,是vboxvfs模块已被加载,可用lsmod |grep vbox 查看。
可以将下列加入到/etc/fstab文件中,以后每次开机都会自动完成这个mount。
ubuntu(数据空间名称) /home/honwsn/Desktop/Doc(要挂载的目录) vboxsf defaults 0 0