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

本文共 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

你可能感兴趣的文章
sublime打开TXT文件乱码的问题
查看>>
GraphQL 入门: 简介
查看>>
git github小白看过来——中午篇
查看>>
socket.io+redis+nodejs+nginx集群部署
查看>>
Angular 4.x EventManager & Custom EventManagerPlugin
查看>>
TP后台权限管理笔记
查看>>
客户端通过SSH private key 登录远端服务器
查看>>
ASP.NET SignalR增加Azure支持
查看>>
Micronaut教程:如何使用基于JVM的框架构建微服务
查看>>
利用Apache Spark SQL和DataFrames扩展关系数据库
查看>>
立下“去O”Flag的AWS,悄悄修炼了哪些内功?
查看>>
Mango 的组织重构
查看>>
Spring Boot 2.2首个里程碑版本发布,改进性能和内存使用
查看>>
James Grenning访谈录:关于测试驱动开发及代码异味
查看>>
最重要的就是做正确的事
查看>>
SUM
查看>>
旷视砸20亿进军AIoT,发布国内首个机器人协作大脑河图
查看>>
持续交付模型中文化转型的重要意义
查看>>
IE安全系列:IE浏览器的技术变迁(上)
查看>>
Facebook引入Haskell升级Sigma防御系统
查看>>