AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[vagrant](ubuntu)

Martin Hope
Ashikur Rahman
Asked: 2020-07-03 13:42:38 +0800 CST

如何安装最新版本的 Vagrant

  • 1

我已经从下载 |下载了 vagrant 2.2.9 64 位安装文件。流浪汉。它不是 .deb 文件,它没有任何扩展名,所以我不明白如何使用这个文件安装 vagrant。它仅在文件图标中以绿色字母显示exec。

如何使用此文件在我的 ubuntu 18.04.4 中安装 vagrant?或者有没有其他方法可以安装最新版本的 Vagrant?

vagrant 18.04
  • 2 个回答
  • 414 Views
Martin Hope
Raghuveer
Asked: 2020-06-05 01:35:45 +0800 CST

更新 Vagrant 的存储库版本

  • 0

我想安装最新的 Vagrant,所以按照以下步骤操作:

 sudo apt-get update

其他一些回购链接已损坏,我不想更新它。正如网上建议的那样,我已经sudo rm -rf /var/lib/apt/lists/*运行了,并没有太大帮助。如何跳过此错误并继续下一次更新?

 sudo apt-get install vagrant

但是我已经运行了上述命令,并且安装了 2.0.2 版本的 vagrant,因为最新的是 2.2.9,我如何更新存储库 URL 以更新版本,以便我获得最新版本。

vagrant 18.04
  • 1 个回答
  • 475 Views
Martin Hope
Moshe Katz
Asked: 2020-05-26 09:13:06 +0800 CST

无法启动 20.04 的官方 Vagrant 盒子

  • 5

我正在尝试使用官方的ubuntu/focal64Vagrant box来运行一些新的虚拟机。我已经尝试过版本v20200518.0.0和v20200522.0.0(我测试的最新版本)。我正在使用 Vagrant 2.2.9,并尝试使用 VirtualBox 6.0.4 和 6.1.8。

我的 Vagrantfile 非常简单:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"
  config.vm.box_version = "20200522.0.0"

  config.vm.define "db1" do |db1|
    db1.vm.network "private_network", ip: "192.168.56.10"
  end

  config.vm.define "db2" do |db2|
    db2.vm.network "private_network", ip: "192.168.56.11"
  end

  config.vm.define "app1" do |app1|
    app1.vm.network "private_network", ip: "192.168.56.20"
  end
end

(稍后我计划为每个盒子添加配置,但这是一个简单的测试,只是为了开始。)

问题是这些盒子无法启动。这是我得到的错误:

[  148.806822] VFS: Cannot open root device "PARTUUID=43931bda-01" or unknown-block(0,0): error -6
[  151.754729] Please append a correct "root=" boot option: here are the available partitions
[  154.534996] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[  157.312019] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-31-generic #35-Ubuntu
[  159.842670] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006

之后有一个堆栈跟踪,但我无法获得截图,因为盒子重启太快了。

当我尝试使用这些ubuntu/bionic64图像时,它们工作正常。只有新focal64图像似乎被破坏了。

如何让这些虚拟机启动?

virtualbox vagrant 20.04
  • 1 个回答
  • 1571 Views
Martin Hope
Adam
Asked: 2020-01-20 08:20:00 +0800 CST

vboxdrv 内核模块未加载

  • 2

我正在使用Vagrant。当我尝试启动它时,我遇到了这个问题(过去一年它一直在工作,不知道为什么它突然失败 - 我没有更新任何东西):

被请求支持机器“宅基地”的提供者“virtualbox”报告说它在这个系统上不可用。原因如下图:

VirtualBox 抱怨内核模块未加载。请运行VBoxManage --version或打开 VirtualBox GUI 以查看错误消息,其中应包含有关如何修复此错误的说明。

运行VBoxManage --version 返回:

警告:未加载 vboxdrv 内核模块。当前内核(5.3.0-26-generic)没有可用的模块,或者无法加载。请重新编译内核模块并安装它

       sudo /sbin/vboxconfig

     You will not be able to start VMs until this problem is fixed.

6.0.10r132072

运行sudo /sbin/vboxconfig 返回:

vboxdrv.sh:停止 VirtualBox 服务。vboxdrv.sh:启动 VirtualBox 服务。vboxdrv.sh:构建 VirtualBox 内核模块。vboxdrv.sh:失败:查看 /var/log/vbox-setup.log 以找出问题所在。

设置 VirtualBox 时出现问题。要重新启动设置过程,请以 root 身份运行 /sbin/vboxconfig。如果您的系统使用 EFI 安全启动,您可能需要在加载内核模块(vboxdrv、vboxnetflt、vboxnetadp、vboxpci)之前对其进行签名。请参阅您的 Linux 系统的文档以获取更多信息。

日志文件非常大。我把它贴在这里。

有什么建议我需要做些什么来解决这个问题?

virtualbox kernel vagrant
  • 1 个回答
  • 3030 Views
Martin Hope
Enrique Moreno Tent
Asked: 2018-04-20 07:25:11 +0800 CST

无法 ping 使用 NAT 创建的虚拟机

  • 1

所以我在我的主机(Ubuntu 17.10)中创建了一个带有 VirtualBox + Vagrant + Ansible 的虚拟机。

Vagrant.configure("2") do |config|

  config.vm.box = "centos-7.3-x86_64_latest.box"
  config.vm.box_url = "http://nas.my-compamy.intern/centos-7.3-x86_64_latest.box"

  config.vm.hostname = "login.my-cloud.dev"
  config.vm.network "private_network", ip: "192.168.33.240"

  # enable to use synced folders
  # config.vm.synced_folder "/my/local/path", "/var/www/cce_login", disabled: true

  config.ssh.forward_agent = true
  config.ssh.keep_alive = true
  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"

  config.vm.provider :virtualbox do |v|
    # workaround as some virtualbox version seem to disconnect the NAT adapter
    v.customize ['modifyvm', :id, '--cableconnected1', 'on']

    v.memory = 1024
    v.cpus = 2
    v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
    v.customize ["modifyvm", :id, "--name", "login.cce-cloud.dev"]
    v.customize ["modifyvm", :id, "--accelerate3d", "off"]
    v.customize ["modifyvm", :id, "--accelerate2dvideo", "off"]
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"]
    v.customize ["modifyvm", :id, "--largepages", "on"]
  end

  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "ansible/site.yml"
    ansible.verbose = "vvv"
  end

end

我通过

$ vagrant up --provision

完成所有这些之后,我可以像这样通过 Vagrant 登录 SSH。

$ vagrant ssh

但是当我想从 MySQL Workbench、FTP 访问或直接 SSH 中使用它时,我得到一个错误。我什至无法ping通机器。

$ ping 192.168.33.240

PING 192.168.33.240 (192.168.33.240) 56(84) bytes of data.
From 192.168.33.1 icmp_seq=1 Destination Host Unreachable
From 192.168.33.1 icmp_seq=2 Destination Host Unreachable
From 192.168.33.1 icmp_seq=3 Destination Host Unreachable

由于我没有从 DevOps 团队更改 Vagrantfile 的权限,我认为错误一定出在我的主机配置方式中,但我似乎看不出问题出在哪里。

$ ifconfig 

enxdc9b9cee07b2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.111.198  netmask 255.255.255.0  broadcast 192.168.111.255
        inet6 fe80::f0ad:1d52:8e55:7fc7  prefixlen 64  scopeid 0x20<link>
        ether dc:9b:9c:ee:07:b2  txqueuelen 1000  (Ethernet)
        RX packets 11159  bytes 4878538 (4.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8289  bytes 2106425 (2.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1607  bytes 173261 (173.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1607  bytes 173261 (173.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.33.1  netmask 255.255.255.0  broadcast 192.168.33.255
        inet6 fe80::800:27ff:fe00:0  prefixlen 64  scopeid 0x20<link>
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 170  bytes 18067 (18.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

如何更改主机操作系统的配置,使其达到虚拟操作系统?

注意:这enxdc9b9cee07b2是我的有线连接。我知道通常是这样,eth0但我正在使用 USB 端口的适配器

更新

更多信息

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

networking virtualbox vagrant ping
  • 2 个回答
  • 6010 Views
Martin Hope
Javier Galarza
Asked: 2018-02-01 09:15:48 +0800 CST

无法执行新的预安装脚本 (/var/lib/dpkg/tmp.ci/preinst)

  • 3

我尝试在使用generic/ubuntu1604图像的 vagrant box 中安装一个 .deb 文件,但出现以下错误:

Reading package lists... Done
Building dependency tree

Reading state information... Done
Reading state information... Done

A queue based service for watching directories for files to process as per its configuration.
Do you want to install the software package? [y/N]:y
(Reading database ... 108439 files and directories currently installed.)
Preparing to unpack wtbuild.deb ...
dpkg (subprocess): unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst): No such file or directory
dpkg: error processing archive wtbuild.deb (--install):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 wtbuild.deb

错误

这只发生在该图像上。如果我尝试在我的 linux 机器( xenial )或另一个具有不同 linux 映像的 vagrant box 中安装相同的 .deb 文件,则 .deb 文件安装正确。

dpkg deb vagrant
  • 1 个回答
  • 7396 Views
Martin Hope
rubo77
Asked: 2015-01-06 14:38:37 +0800 CST

在 14.10 上安装 vagrant 1.5 或更高版本

  • 12

有没有办法安装比存储库中更新的版本?

Ubuntu 目前安装 vagrant 1.4.3,但我至少需要 1.5

vagrant
  • 5 个回答
  • 21840 Views
Martin Hope
Marius Gedminas
Asked: 2010-11-07 07:09:38 +0800 CST

我在哪里可以找到 Vagrant 包?

  • 11

Vagrant是一个为开发人员构建和管理虚拟机的工具。它有一个Ubuntu入门指南,其中包含看起来很可疑的建议,例如

$ sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby  # wtf???

或者从源代码而不是从 Ubuntu 软件包安装 RubyGems,然后使用gem install它来安装 vagrant 本身。

只是按照这些指示,我感觉不舒服。可能有 PPA 吗?是否有为 Ubuntu 打包的替代工具?

package-management ppa virtualization vagrant
  • 4 个回答
  • 14237 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve