博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vagrant up下载box慢的解决办法
阅读量:5766 次
发布时间:2019-06-18

本文共 4314 字,大约阅读时间需要 14 分钟。

即在运行vagrant up时得到其的下载路径,如:

https://vagrantcloud.com/ubuntu/boxes/xenial64/versions/20190101.0.0/providers/virtualbox.box

然后直接在浏览器上访问该网址来下载该box

先查看本地安装的box:

userdeMBP:ubuntu-16.04 user$ vagrant box listhashicorp/precise64           (virtualbox, 1.1.0)hashicorp/vagrant-share       (virtualbox, 0.1.0)tknerr/baseimage-ubuntu-12.04 (docker, 1.0.0)

再将得到的box文件手动添加进去:

userdeMBP:ubuntu-16.04 user$ vagrant box add --name ubuntu/xenial64 /Users/user/ubuntu-16.04/xenial-server-cloudimg-amd64-vagrant.box==> box: Box file was not detected as metadata. Adding it directly...==> box: Adding box 'ubuntu/xenial64' (v0) for provider:     box: Unpacking necessary files from: file:///Users/user/ubuntu-16.04/xenial-server-cloudimg-amd64-vagrant.box==> box: Successfully added box 'ubuntu/xenial64' (v0) for 'virtualbox'!

然后再查看本地果然多了一个新的box:

userdeMBP:ubuntu-16.04 user$ vagrant box listhashicorp/precise64           (virtualbox, 1.1.0)hashicorp/vagrant-share       (virtualbox, 0.1.0)tknerr/baseimage-ubuntu-12.04 (docker, 1.0.0)ubuntu/xenial64               (virtualbox, 0)

然后再在相应vagrantfile对应的目录下运行vagrant up即可运行起来了:

userdeMBP:ubuntu-16.04 user$ vagrant upBringing machine 'default' up with 'virtualbox' provider...==> default: Importing base box 'ubuntu/xenial64'...==> default: Matching MAC address for NAT networking...==> default: Setting the name of the VM: ubuntu-1604_default_1546496409973_90048==> default: Vagrant has detected a configuration issue which exposes a==> default: vulnerability with the installed version of VirtualBox. The==> default: current guest is configured to use an E1000 NIC type for a==> default: network adapter which is vulnerable in this version of VirtualBox.==> default: Ensure the guest is trusted to use this configuration or update==> default: the NIC type using one of the methods below:==> default: ==> default:   https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type==> default:   https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type==> 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: Running 'pre-boot' VM customizations...==> 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: Warning: Connection reset. Retrying...    default: Warning: Remote connection disconnect. Retrying...    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: 5.1.38    default: VirtualBox Version: 5.2==> default: Mounting shared folders...    default: /vagrant => /Users/user/ubuntu-16.04

然后使用vagrant ssh即可进入:

userdeMBP:ubuntu-16.04 user$ vagrant sshWelcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-141-generic x86_64) * Documentation:  https://help.ubuntu.com * Management:     https://landscape.canonical.com * Support:        https://ubuntu.com/advantage  Get cloud support with Ubuntu Advantage Cloud Guest:    http://www.ubuntu.com/business/services/cloud0 packages can be updated.0 updates are security updates.New release '18.04.1 LTS' available.Run 'do-release-upgrade' to upgrade to it.vagrant@ubuntu-xenial:~$

 

转载于:https://www.cnblogs.com/wanghui-garcia/p/10213964.html

你可能感兴趣的文章
mybatis学习笔记之学习目录(1)
查看>>
我的IDEA配置
查看>>
myeclipse显示行号
查看>>
编写高性能的java程序
查看>>
C# 文件操作封装类(删除,移动,复制,重命名)
查看>>
Spring 的配置详解
查看>>
linux已经不存在惊群现象
查看>>
上位机和底层逻辑的解耦
查看>>
计蒜客 墙壁涂色
查看>>
Web模板引擎—Mustache
查看>>
学习进度条
查看>>
关于微信二次分享 配置标题 描述 图片??
查看>>
springcloud使用zookeeper作为config的配置中心
查看>>
hystrix实战之javanica
查看>>
bs4取数
查看>>
Maven安装以及为Eclipse指定Maven
查看>>
校园火灾Focue-2---》洗手间的一套-》电梯
查看>>
css控制文字换行
查看>>
bzoj1913
查看>>
bzoj2301(莫比乌斯反演)
查看>>