VitualBox + Vagrant 搭虚拟机

Install VirtualBox and Vagrant

Box: Execute commands

ubuntu.box

vagrant init ubuntu/trusty64
vagrant up

result

==> default: Successfully added box 'ubuntu/trusty64' (v20170918.0.0) for 'virtualbox'!
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: VOS_default_1505893534153_40845
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 4.3.36
    default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
    default: /vagrant => /Users/bqliu/Documents/VOS

Check

vagrant box list

Setup Network

config.vm.network "private_network", ip: "192.168.33.10"

Restart VM

vagrant up

SSH

vagrant ssh
...
sudo passwd

Command

stop:vagrant halt
restart:vagrant reload
destroy:vagrant destroy

My Pair: Yaxin

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 1,介绍Vagrant 我们做web开发的时候经常要安装各种本地测试环境,比如apache,php,mysql,r...
    meng_philip123阅读 2,614评论 0 12
  • 虚拟开发环境 在项目开发中,我们经常会遇到各种各样的问题,需要使用虚拟开发环境来完成,虚拟和正式环境一样的虚拟开发...
    sunnyaxin阅读 6,718评论 4 6
  • 最近服务器老是宕机,学习的时候很多环境有需要集群,忍无可忍的情况下终于决定自己装一波虚拟机宫学习使用。本人系统为D...
    行书以鉴阅读 2,041评论 0 1
  • 我总觉得,我们把“自律”看得太重了。我更愿意把“自律”视为一种“天赋”,只有极少数人拥有超高的技能点。当然,也有一...
    安河桥以北阅读 257评论 0 0
  • 今天的葆婴年会内容,一定要分享的是她的演讲,您看过她的书吗?【张德芬】华语心灵大师:(1)卓越是指 共赢!(2)发...
    此生为何而来阅读 239评论 1 0

友情链接更多精彩内容