小编mli*_*elt的帖子

如何配置 Vagrant 来设置代理并使用它?

我有以下设置:

  • 视窗 7 电脑
  • 安装 Ruby、Vagrant、VirtualBox
  • VBox 图像 Ubuntu 14.x
  • 在我公司的内网工作,需要代理上网

通过将环境变量设置http_proxy为我们的代理,我能够为用户 vagrant 配置 VBox 图像以访问互联网。但是,当我尝试在 shell 配置器中设置代理时,我遇到了问题。以下是定义代理的脚本部分,以及首次访问互联网的部分:

# Base setup proxy and DISPLAY
set HTTP_PROXY=http://proxy.name.com:8080
echo "Add proxy to necessary parts"
echo 'export http_proxy=http://proxy.name.com:8080' >> ~vagrant/.bash_profile
echo 'export DISPLAY=192.168.137.1:0.0' >> ~vagrant/.bash_profile
echo 'export http_proxy=http://proxy.name.com:8080' >> /root/.bash_profile
export http_proxy=$HTTP_PROXY

# Install Git
echo "Install Git"
apt-get update
apt-get install -y git
...
Run Code Online (Sandbox Code Playgroud)

但是,我得到以下输出:

Add proxy to necessary parts
Install Git
Err http://security.ubuntu.com trusty-security InRelease

Err http://archive.ubuntu.com trusty InRelease …
Run Code Online (Sandbox Code Playgroud)

proxy vagrant

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

proxy ×1

vagrant ×1