我在公司代理后面的Windows 10上使用流浪汉2.2.5。
所有CLI命令都挂起。让我们用它vagrant help
来说明我的问题。
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
表明它挂在
DEBUG checkpoint_client: waiting for checkpoint to complete...
继续
INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x0000000004b32910>
我注意到,如果断开网络连接(飞行模式,拔掉以太网电缆),情况会好很多:
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
如果配置代理,那就更好了:
$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
相比之下,在WSL(Linux的Windows Subsytem)中,在所有情况下(与连接无关),速度要快得多:
$ 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
由于我的WSL Ubuntu中的vagrant版本为2.0.2,因此我也在Windows上对此版本进行了测试。我有相同的行为。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句