follow Sam哥 OS 课程的漫长之路 Day2

本文记录了使用Vagrant和VirtualBox搭建开发环境的过程,包括解决安装过程中的各种问题,如通过代理解决连接错误、安装make和qemu等。

今天继续装环境……前言提要,由于怎么都make不了,把lucid32换成precise32了。

add是没问题的:

$ vagrant box add precise32 E:/HashiCorp/precise32.box
==> box: Box file was not detected as metadata. Adding it directly…
==> box: Adding box ‘precise32’ (v0) for provider:
box: Unpacking necessary files from: file:///E:/HashiCorp/precise32.box
box:
==> box: Successfully added box ‘precise32’ (v0) for ‘virtualbox’!

执行

vagrant init
vagrant up

出现

$ vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Box ‘base’ could not be found. Attempting to find and install…
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly…
==> default: Adding box ‘base’ (v0) for provider: virtualbox
default: Downloading: base
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn’t open file /E:/precise32/base

换成命令

vagrant init hashicorp/precise32

再次

$ vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Box ‘hashicorp/precise32’ could not be found. Attempting to find and install…
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box ‘hashicorp/precise32’
default: URL: https://atlas.hashicorp.com/hashicorp/precise32
==> default: Adding box ‘hashicorp/precise32’ (v1.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Unknown SSL protocol error in connection to hashicorp-files.hashicorp.com:443

找了下很多人都有这个问题。

Vagrant Error: Failed to connect to atlas.hashicorp.com

https://techythought.wordpress.com/2016/04/11/vagrant-error-failed-to-connect-to-atlas-hashicorp-com/
https://github.com/mitchellh/vagrant/issues/3586
解决方案让用代理。

连忙搞了个shadowsocks,设置全局代理搞定。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise32'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: 44465_default_1489070710386_38685
==> 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.2.0
    default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
    default: /vagrant => E:/Cygwin/home/44465

好像还是有点问题……不管了,先试试能不能继续- -

这次安装make成功了!

vagrant@precise32:/vagrant$ sudo apt-get install make
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  make-doc
The following NEW packages will be installed:
  make
0 upgraded, 1 newly installed, 0 to remove and 66 not upgraded.
Need to get 116 kB of archives.
After this operation, 319 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main make i386 3.81-8.1ubuntu1 [116 kB]
Fetched 116 kB in 3s (31.3 kB/s)
Selecting previously unselected package make.
(Reading database ... 29361 files and directories currently installed.)
Unpacking make (from .../make_3.81-8.1ubuntu1_i386.deb) ...
Processing triggers for man-db ...
Setting up make (3.81-8.1ubuntu1) ...

但是Chap2的两个命令都执行不了

vagrant@precise32:/vagrant$ make all
make: *** No rule to make target `all'.  Stop.
vagrant@precise32:/vagrant$ make run
make: *** No rule to make target `run'.  Stop.

Dunno why.

不管了,貌似也是要用到qemu的,自己先装一下。

$ sudo apt-get install qemu

REF: https://www.ibm.com/developerworks/community/blogs/5144904d-5d75-45ed-9d2b-cf1754ee936a/entry/qemu1_%25e4%25bd%25bf%25e7%2594%25a8qemu%25e5%2588%259b%25e5%25bb%25ba%25e8%2599%259a%25e6%258b%259f%25e6%259c%25ba?lang=en

又跟昨天差不多,貌似由于域名迁移有些文件下载不了。

继续漫长的斗争。。。

$ sudo apt-get update

用了全局代理果然好很多,update没报错。
安装qemu也很顺利。但还是没办法运行那两个命令,囧。

暂且准备到此…

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值