[英]vagrant CLI hangs on Windows 10
I am using vagrant 2.2.5 on Windows 10 behind a company proxy. 我在公司代理后面的Windows 10上使用流浪汉2.2.5。
All CLI commands hang. 所有CLI命令都挂起。 Let's use
vagrant help
to illustrate my problem. 让我们使用
vagrant help
来说明我的问题。
vagrant help
takes more than 30s. vagrant help
需要30多个时间。
Measure-Command {start-process vagrant -argumentlist "help" -Wait}
Days : 0
Hours : 0
Minutes : 0
Seconds : 36
Milliseconds : 94
Ticks : 360943091
TotalDays : 0,000417758207175926
TotalHours : 0,0100261969722222
TotalMinutes : 0,601571818333333
TotalSeconds : 36,0943091
TotalMilliseconds : 36094,3091
vagrant help --debug
shows that it's hanging on vagrant help --debug
表明它挂了
DEBUG checkpoint_client: waiting for checkpoint to complete...
and on 继续
INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x0000000004b32910>
I noticed that if I disconnect from the network (airplane mode, ethernet cable unplugged), it gets a lot better: 我注意到,如果断开网络连接(飞行模式,拔掉以太网电缆),情况会好很多:
Measure-Command {start-process vagrant -argumentlist "help" -Wait}
Days : 0
Hours : 0
Minutes : 0
Seconds : 5
Milliseconds : 14
Ticks : 50147343
TotalDays : 5,804090625E-05
TotalHours : 0,00139298175
TotalMinutes : 0,083578905
TotalSeconds : 5,0147343
TotalMilliseconds : 5014,7343
It's even better if I configure a proxy: 如果配置代理,那就更好了:
$env:HTTP_PROXY="http://my.proxy.host:port"
$env:HTTPS_PROXY="http://my.proxy.host:port"
Measure-Command {start-process vagrant -argumentlist "help" -Wait}
Days : 0
Hours : 0
Minutes : 0
Seconds : 2
Milliseconds : 24
Ticks : 20249878
TotalDays : 2,34373587962963E-05
TotalHours : 0,000562496611111111
TotalMinutes : 0,0337497966666667
TotalSeconds : 2,0249878
TotalMilliseconds : 2024,9878
By comparison, in WSL (Windows Subsytem For Linux), it's a lot faster in all cases (not dependent on connectivity): 相比之下,在WSL(Linux的Windows子系统)中,在所有情况下(与连接无关),速度要快得多:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
$ time vagrant help
(...)
real 0m1.043s
user 0m0.500s
sys 0m0.469s
As vagrant is in version 2.0.2 in my WSL Ubuntu, I tested also with this version on Windows. 由于我的WSL Ubuntu中的vagrant版本为2.0.2,因此我也在Windows上对此版本进行了测试。 I had the same behaviour.
我有相同的行为。
The problem was somehow the access to the network. 问题在于以某种方式访问网络。
Vagrant's support explained in the issue I opened that vagrant will regularly check for new releases to notify the user whenever there is a new one. 我在打开的问题中解释了流浪者的支持,即流浪者会定期检查是否有新版本,以便在有新版本时通知用户。
If network access is slow or hangs, then every command will wait for it, because vagrant will try until it gets an answer. 如果网络访问速度慢或挂起,则每个命令都将等待它,因为流浪汉将尝试直到获得答案。
Only then, it will wait for a while before trying again. 只有这样,它才会等待一段时间,然后重试。
To disable this polling, just set the environment variable VAGRANT_CHECKPOINT_DISABLE
. 要禁用此轮询,只需设置环境变量
VAGRANT_CHECKPOINT_DISABLE
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.