不知道为什么我有这个问题,但我不能添加流浪盒.
使用Windows 10,尝试使用powershell和简单的命令提示符.同样的问题.这是一个相对新鲜的Windows安装.也许我错过了一些必需的包裹?
首先我尝试了这个命令:
vagrant box add hashicorp/precise32
Run Code Online (Sandbox Code Playgroud)
并得到错误:
The box 'hashicorp/precise32' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/hashicorp/precise32"]
Error:
Run Code Online (Sandbox Code Playgroud)
所以我手动下载了这个盒子并尝试了这个:
vagrant box add base64 file:///D:/downloads/vagrant_boxes/precise64.box
Run Code Online (Sandbox Code Playgroud)
并再次出现此错误:
==> box: Box file was not detected as metadata. Adding it directly...
==> box: …Run Code Online (Sandbox Code Playgroud) 我在我的Windows 10机器笔记本电脑上安装了PyCharm Professional 2017.3.2,并将其配置为使用运行conda环境的Vagrant Ubuntu 16.04服务器(Virtualbox)VM作为远程解释器.我能够使用这个环境执行Python脚本,但数字不会显示.例如,尽管命令没有呈现图形,但https://www.jetbrains.com/help/pycharm/scientific-mode-tutorial.html中的示例返回退出代码0 plt.show().没有报告错误.
给出的后端matplotlib.get_backend()是module://backend_interagg.我已经看到提到DISPLAY在VM上设置或安装Xorg,但这似乎是在后端使用QT时来自较旧的帖子.任何人都可以建议如何使用最近的设置显示情节?
我的Windows主机上有下一个流浪文件
Vagrant.configure(2) do |config|
config.vm.provider :virtualbox do |v|
v.customize [
"modifyvm", :id,
"--memory", 1024,
"--cpus", 1,
]
end
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.0.101"
end
Run Code Online (Sandbox Code Playgroud)
虚拟机正常启动但无法通过"192.168.0.101"ip从主机访问.guest上的/ etc/network/interface是
auto lo
iface lo inet loopback
source /etc/network/interfaces.d/*.cfg
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet static
address 192.168.0.101
netmask 255.255.255.0
#VAGRANT-END
Run Code Online (Sandbox Code Playgroud)
和/etc/network/interfaces.d/eth0.cfg是
auto eth0
iface eth0 inet dhcp
Run Code Online (Sandbox Code Playgroud)
此外,每次运行该流浪者后,都会创建新的虚拟网络适配器,在Virtualbox UI工具中,我会看到有关该新网络的信息 - 真正的IP是不同的,随机的,即169.254.173.8.我有> 20个虚拟网络:)由此IP客户机器也是自己的.但重新启动后,将使用新IP创建新网络
如何运行静态不可变IP的流浪机?我需要构建具有多个节点的集群,每个节点必须知道每个节点的IP
更新: 在Linux主机上一切都没问题.我可以ping我主机上的所有客人和guets看到对方在Windows上客人无法ping其他客人,即192.168.0.101看不到192.168.0.102
升级到Windows 10后运行:
$ vagrant up
Run Code Online (Sandbox Code Playgroud)
我们收到以下错误消息
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.
Script: get_vm_status.ps1
Error:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
ntimeException
+ FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1
Run Code Online (Sandbox Code Playgroud)
随着Vagrant 1.7.4.
有任何想法吗?
经常在Windows上的Vagrant VM上运行ansible-playbook时,我需要按Ctrl + C停在某个中间位置.如果ansible变得没有响应或者我们需要尽快修复一些错误,就会发生这种情况,因此在配置程序完成之前没有必要等待.
探测是Ctrl + C不起作用,一些2个ruby.exe进程卡在进程树中.在手动终止这些ruby进程之前,任何后续的vagrant命令都会失败.
在运行新配置之前,我还用来杀死VM上所有被卡住的python ansible进程.
有什么方法可以更好地处理它吗?
vagrant up第一次在Windows上运行时,我希望它先下载然后缓存该框。但是,如果我vagrant halt随后运行,vagrant up我最终将不得不等待15分钟才能下载并重新组装计算机。当我运行时vagrant box list,它指出它的基本框已在其中列出,那么我还需要做什么来使用缓存?
default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/vers
ions/20150902.0.0/providers/virtualbox.box
default: Progress: 94% (Rate: 301k/s, Estimated time remaining: 0:01:20))
Run Code Online (Sandbox Code Playgroud)
我记得读某处的文件中,有一个config.vm.box_check_update,将导致它来检查每个更新版本当前框的vagrant up,但我没有看到它在上市Vagrantfile的WordPress的-VVV。
virtualbox vagrant vagrantfile vagrant-windows vvv-wordpress
此错误之前已在帖子中报告过:VBoxManage:错误:无法创建仅主机适配器,并且对于新版本的 Windows/vagrant/OracleVB 不断重复发生,如下所述。如果有人为下面描述的设置确定了此问题的解决方案,请在此处分享:
"bento/ubuntu-14.04"图像我安装了 Oracle VB,然后安装了 Vagrant(都是全新安装的),然后在vagrant up我的一个工作区中以 usuas 身份运行。vagrant 下载完虚拟盒后,在尝试启动 VM 时给出以下错误输出:
C:\Users\AHL\workspace>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-14.04' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'bento/ubuntu-14.04'
default: URL: https://atlas.hashicorp.com/bento/ubuntu-14.04
==> default: Adding box 'bento/ubuntu-14.04' (v2.2.9) for provider: virtualbox …Run Code Online (Sandbox Code Playgroud) 我有这个 Vagrantfile。在这里,我将所有 VM 的内存定义为 2048。但是我希望我的傀儡师有 4096 和代理有 2048。如何做到这一点?
Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
config.vm.define "puppetmaster" do |pm|
pm.vm.box = "centos/7"
pm.vm.network "private_network", ip: "192.168.33.10"
pm.vm.hostname = "puppetmaster"
end
config.vm.define "puppet-agent-centos" do |pac|
pac.vm.box = "centos/7"
pac.vm.network "private_network", ip: "192.168.33.11"
pac.vm.hostname = "centos-agent"
end
config.vm.define "puppet-agent-ubuntu" do |pau|
pau.vm.box = "ubuntu/xenial64"
pau.vm.network "private_network", ip: "192.168.33.12"
pau.vm.hostname = "ubuntu-agent"
end
end
Run Code Online (Sandbox Code Playgroud)
谢谢!
我正在使用安装了 vagrant box 的 Windows 笔记本电脑,在那里我有一个 kubectl 客户端来管理一些外部 kubernetes 集群。
出于调试目的,我想通过 kubectl 进行端口转发并从主机访问此端口。这从 vagrant 内部到 kubernetes 集群都可以完美运行,但显然有些东西与从主机到 vagrant 的 vagrant 端口转发一起不起作用。
这是我的设置:
Vagrant 中的端口转发:
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct:false
在 Kubernetes 中启动 nginx 容器:
kubectl run -i -t --image nginx test
将端口转发到本地主机(在 vagrant 内部):
kubectl port-forward test-64585bfbd4-zxpsd 8080:80
测试在 vagrant-box 中运行的 nginx:
vagrant@csbox:~$ curl http://localhost:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head> …Run Code Online (Sandbox Code Playgroud)我通过 ssh\xe2\x80\x99d 进入开发环境(vagrant Ubuntu box),并且我的项目目录映射到另一个文件系统(通过 vbox),因此不支持符号链接。我正在尝试创建一个新的 venv,但 --copies 标志不受\xe2\x80\x99t 的尊重。
\n\n$sudo python -m venv --copies venv \nError: [Errno 71] Protocol error: 'lib' -> '/home/vagrant/vagrant_projects/rurp/venv/lib64'\nRun Code Online (Sandbox Code Playgroud)\n\n如果我使用 python 2.7 ($virtualenv venv --always-copy) 它可以工作,但不能与 python3 venv --copies 实现一起使用。--always-copy 参数是针对 python2.x 的类似问题的解决方法。
\n\n我在网上找不到任何表明 venv 存在错误的内容,我有点不知所措。其他人遇到过这个问题吗?
\n\n$ python -V\nPython 3.6.9\nRun Code Online (Sandbox Code Playgroud)\n\n先感谢您。
\n\n编辑:还在 python 3.8.1 中进行了测试。
\nvagrant-windows ×10
vagrant ×9
virtualbox ×3
vagrantfile ×2
kubectl ×1
kubernetes ×1
matplotlib ×1
networking ×1
pycharm ×1
python ×1
python-3.x ×1
python-venv ×1
windows-10 ×1