标题:用VirtualBox在Windows上搭建一个Ubuntu工作站 出处:Felix021 时间:Mon, 29 Mar 2010 14:53:53 +0000 作者:felix021 地址:https://www.felix021.com/blog/read.php?1873 内容: @2010-10-30 建議看 加強版: http://www.felix021.com/blog/read.php?1921 用VirtualBox在Windows上搭建一个Ubuntu工作站 目标 1. 没有多余窗口 2. Ubuntu少占资源 3. Ubuntu可以上外网 4. 可以ssh连上去搞开发 实现 1. 在Vbox上安装一个Ubuntu 2. 整两个网卡,一个host-only,一个NAT。 3. 安装好ssh-server 4. 如果有gdm(desktop/alternative),干掉 sudo update-rc.d -f gdm remove; cd /etc/X11/,在default-display-manager的第一行(gdm)前加个#注释掉 5. 编译这个东西,可执行程序放到program files\sun\virtualbox\下面,比如叫做startvm#include #include using namespace std; int main(int argc, char * argv[]) { string param = string(" -startvm ") + argv[1]; ShellExecute(NULL, "open", "vboxheadless", param.c_str(), "c:", SW_HIDE); //使用SW_HIDE就不会看到vboxheadless的命令行窗口了 return 0; } 6. 运行 startvm "虚拟机名" 7. 打开SecureCRT连上去干活吧 8. 可以使用VBoxManage controlvm "虚拟机名" start|poweroff|pause|resume|savestate...等来控制虚拟机的运行状态 其他 1. 如果需要开机自启动,稍微改改这个程序或者搞个bat扔到startup里面去,或者干脆注册一个服务。 Generated by Bo-blog 2.1.0