MAC下用VirtualBox跑ubuntu的一点经验
来源:互联网 发布:怪物世界源码 编辑:程序博客网 时间:2024/06/03 16:22
软件版本:
MAC OSX:10.8.4,VirtualBox:4.2.16,ubuntu:ubuntu-12.04.2-desktop-amd64。安装ubuntu
安装有两种方式:
- 跳过安装,直接从虚拟光驱启动。这有两个问题,一是会占用虚拟光驱,二是重启ubuntu后,以前的配置都丢失了。
- 安装ubuntu到虚拟硬盘上。
安装Guest Additions
如果要用VirtualBox自带的共享文件夹功能,必须先安装Guest Additions。安装方法:置顶的菜单条->devices->Install Guest Additions。
点击安装后,VirtualBox会把虚拟光驱中的已有的iso文件弹出,加载VBoxGuestAdditions.iso,然后运行。
如果直接从虚拟光驱启动,会出现已有iso不能弹出。在google上搜了半天,没有找到适合的解决方案。我后来自己想出一个好办法。
- 把/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso复制到home目录下,这一步是因为在下一步选择iso文件时,我不知道怎么进入/Applications/VirtualBox.app/Contents/MacOS目录。
- 在存储树里面增加一个光驱,用它来加载VBoxGuestAdditions.iso,如图所示。把ubuntu的iso设置成第一IDE控制器主通道,VBoxGuestAdditions.iso设置成从通道。
- 在ubuntu中,进入cdrom,执行autorun.sh,输出如下:
Verifying archive integrity... All good.Uncompressing VirtualBox 4.2.16 Guest Additions for Linux............VirtualBox Guest Additions installerRemoving installed version 4.2.16 of VirtualBox Guest Additions...Copying additional installer modules ...Installing additional modules ...Removing existing VirtualBox non-DKMS kernel modules ...done.Building the VirtualBox Guest Additions kernel modulesThe headers for the current running kernel were not found. If the followingmodule 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.You should restart your guest to make sure the new modules are actually usedInstalling the Window System driversInstalling X.Org Server 1.13 modules ...done.Setting up the Window System to use the Guest Additions ...done.You may need to restart the hal service and the Window System (or just restartthe guest system) to enable the Guest Additions.Installing graphics libraries and desktop services components ...done.Press Return to close this window...
按回车关闭窗口后,安装完成。
设置共享文件夹
点击置顶的菜单条->devices->shared folders后,弹出shared folders窗口,在里面设置共享文件夹。这里有个权限问题,如果让VirtualBox自动mount这个共享文件夹,它会以root用户mount。普通用户访问不了这个目录。我试过用chmod把目录权限改成所有人都能访问,但是没有成功。
在网上找到一个手动挂共享目录的方法:
ubuntu@ubuntu:~$ umask && id0002uid=999(ubuntu) gid=999(ubuntu) groups=999(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)ubuntu@ubuntu:~$ sudo mkdir -p /media/sf_codesubuntu@ubuntu:~$ cd /mediaubuntu@ubuntu:/media$ lscdrom sf_codesubuntu@ubuntu:/media$ cd sf_codes/ubuntu@ubuntu:/media/sf_codes$ lsubuntu@ubuntu:/media/sf_codes$ cd ..ubuntu@ubuntu:/media$ sudo mount -t vboxsf -o umask=002,uid=999,gid=999 codes /media/sf_codes
codes是VirtualBox设置的共享文件夹的目录名,/media/sf_codes是ubuntu上挂接的目录名。
在/etc/fstab增加下面这行,可以自动挂接:
codes /media/sf_codes vboxsf umask=002,uid=999,gid=999
- MAC下用VirtualBox跑ubuntu的一点经验
- Mac 下 VirtualBox ubuntu 共享空间
- Ubuntu下VirtualBox的安装
- win7下用U盘装CentOs5的一点亲身经验
- Ubuntu下配置FLTK的一点经验及使用FLTK编写休息提醒软件
- 给VirtualBox下的Ubuntu虚拟机安装 VirtualBox Guest Additions
- VirtualBox下的Ubuntu的全屏问题。
- VirtualBox下的Ubuntu的全屏问题
- VirtualBox下的Ubuntu的全屏问题。
- ubuntu 下 的virtualbox 安装的问题
- ubuntu下使用VirtualBox的相关问题
- VirtualBox 下的ubuntu如何调整分辨率?
- Ubuntu下VirtualBox的卸载和升级
- VirtualBox下的Ubuntu安装增强功能
- Ubuntu在VirtualBox下的磁盘空间扩展
- 如何修改virtualBox下Ubuntu的虚拟内存
- ubuntu下virtualbox的安装、卸载
- Ubuntu下使用VirtualBox的小技巧
- oracle Wallet的使用
- GIS中的基本算法之判断点是否在直线上
- LightOJ 1289 LCM from 1 to n (节省空间的素数筛法+n个数的最小公倍数)
- VC中常见的108个问题
- 让Windows7的Explorer默认打开“我的电脑”
- MAC下用VirtualBox跑ubuntu的一点经验
- TQ2440开发板存储器
- Android fill_parent、wrap_content的区别
- 反弹球
- jsp
- uva11151 - Longest Palindrome(简单动归)
- NSLineBreakMode 的区别
- 搭建基于crtmpserver的点播解决方案
- HDU1027