您的位置:首页 > 其它

Mac 使用vagrant安装ubuntu环境

2014-09-05 13:27 615 查看
参考 http://blog.linguofeng.com/archive/2014/04/02/mac-osx-vagrant-ubuntu.html

开发过程中,最担心的问题就是程序崩溃,而且还不知道崩溃的原因,现在使用Google Breakpad来跟踪崩溃的位置,非常方便

由于目前使用Mac系统开发,Google Breadpad处理Android崩溃日志时需要Linux环境,借助vagrant可以非常方便地在Mac使用Ubuntu环境

安装brew命令工具

github https://github.com/phinze/homebrew-cask

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"[/code] 安装 wget 命令工具

查看要安装的版本 http://ftp.gnu.org/gnu/wget/

下载 wget

$ cd ~/Downloads
$ curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz[/code] 
解压 wget

$ tar -zxvf wget-1.15.tar.gz


编译和安装

$ cd wget-1.14/
$ ./configure --with-ssl=openssl
$ make
$ sudo make install


清理源文件

$ rm -rf ~/Downloads/wget*

使用vagrant安装ubuntu环境

$ brew tap phinze/cask
$ brew install brew-cask

安装vagrant与virtualbox

$ brew cask install vagrant
$ brew cask install virtualbox

下载ubuntu的box

$ mkdir ubuntu
$ cd ubuntu
$ wget http://files.vagrantup.com/precise32.box[/code] 创建与初始化ubuntu box

$ vagrant box add ubuntu ./precise32.box
$ vagrant init ubuntu

接下来就可以使用ssh登录了

$ vagrant up
$ vagrant ssh


进入ubuntu目录

cd /vagrant/ubuntu

可以讲代码放入ubuntu,在linux环境下编译了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vagrant ubuntu