Skip to content
saberma edited this page Apr 8, 2011 · 2 revisions

开机自动运行虚拟机

正常运行

cd ~/Documents/shopqi
vagrant up

正常启动后,nfs配置会写入 /etc/exports

修改vagrant

让vagrant启动时不提示密码,需要修改vagrant源码

#vagrant-0.7.2/lib/vagrant/hosts/linux.rb
gem which vagrant | sed 's/.rb/\/hosts\/linux.rb/' | xargs vim

先注释掉第27行,第32行

#system(%Q[sudo su root -c “echo ‘#{line}’ >> /etc/exports”])
#system(“sudo /etc/init.d/nfs-kernel-server restart”)

在def nfs_cleanup方法(第35行)下面增加一行

return

开机自启动

把shopqi目录下的script/vagrant_up加到系统启动中
[System]-[Perferences]-[Startup Applications]

Clone this wiki locally