gpt4 book ai didi

azure - Vagrant-Azure : Guest machine can't connect to host machine (Unable to copy SMB files)

转载 作者:行者123 更新时间:2023-12-03 04:06:42 27 4
gpt4 key购买 nike

到目前为止,我一直只在本地使用 Vagrant,现在我想使用 Azure 作为提供程序来创建 VM,但不幸的是,我遇到了错误,可以在通过链接访问的图像上看到该错误。我明白它说的是什么,但我完全不知道如何解决它。 Error

我还附加了我的 Vagrantfile:

require 'vagrant-azure'
Vagrant.configure("2") do |config|
config.vm.box = 'azure'
config.vm.box_url = 'https://github.com/azure/vagrant-azure/raw/master/dummy.box'

config.vm.network "private_network", guest: 80, host: 80

config.ssh.username = 'vagrant'
config.ssh.private_key_path = '~/.ssh/id_rsa'

config.vm.synced_folder '.', '/vagrant', :disabled => true

config.vm.provider :azure do |azure, override|
azure.tenant_id = ****
azure.client_id = ****
azure.client_secret = ****
azure.subscription_id = ****

azure.tcp_endpoints = '80'

azure.vm_name = 'grafmuvivm'
azure.vm_size = 'Standard_B1s'
azure.vm_image_urn = 'Canonical:UbuntuServer:18.04-LTS:latest'
azure.resource_group_name = 'grafmuvirg'
azure.location = 'westeurope'
virtual_network_name = 'grafmuvivm-vagrantPublicIP'
end

# Declare where chef repository path
chef_repo_path = "./chef"

# Provisioning Chef-Zero
config.vm.provision :chef_zero do |chef|
# Added necessary chef attributes
chef.cookbooks_path = 'chef/cookbooks'
chef.nodes_path = 'chef/cookbooks'

#### Adding recipes ####
chef.add_recipe "api::ssh_user"
chef.add_recipe "api::grafmuvi"

# Running recipes
chef.run_list = [
'recipe[api::ssh_user]',
'recipe[api::grafmuvi]'
]
# Accept chef license
chef.arguments = "--chef-license accept"
end
end

如果我运行“vagrant up --debug”,可以看到 guest 计算机无法 ping 通任何主机 IP。

有人可以告诉我如何在 Vagrant 上正确设置网络吗?我检查了与此主题相关的 GitHub 问题,但没有找到任何有用的内容...

编辑:

Running 'vagrant provision'

最佳答案

我使用 Vagrant,但没有使用 Vagrant-azure。但是,您可以通过以下方式更改配置并显示输出:

        azure.vm.network "private_network", ip: "192.168.50.10"

关于azure - Vagrant-Azure : Guest machine can't connect to host machine (Unable to copy SMB files),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59453169/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com