Skip to content

Instantly share code, notes, and snippets.

@bao-qian
Last active June 20, 2017 04:36
Show Gist options
  • Save bao-qian/b6a07063ace590d8b7ae4905238deba4 to your computer and use it in GitHub Desktop.
Save bao-qian/b6a07063ace590d8b7ae4905238deba4 to your computer and use it in GitHub Desktop.
vagrant.md
  1. 准备
  • windows:

    • windows 10 需要禁用 hyper-v
    • windows 需要在 bios 中开启 vt-x / amd-v
    • 下载 virtualbox
  • mac:

    brew cask install virtualbox
    brew cask install vagrant
  1. vagrant 设置
  • 下载并解压 vagrant.zip, 然后进入 vagrant 目录。
  • 运行:
vagrant box add guavm.json
vagrant up
vagrant ssh
  • 结果默认会进入代码所在的 /vagrant 目录:

ubuntu@ubuntu-xenial:/vagrant$

  1. root
  • sudo 没有密码。
  • sudo su 切换成 root 用户。
  1. 端口映射

如果想访问虚拟机内的网站,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment