7

所以我一直在尝试通过 Vagrant/VirtualBox 安装 Laravel Homestead。它以前可以工作,但现在根本不工作。除了来宾机器的错误中提到vagrant up的日志文件之外,我还包括了运行返回的内容。/var/log/vboxadd-install.log以下也是我当前设置的所有版本号。

操作系统:Windows 8.1(64 位),VirtualBox:4.3.26,Vagrant:1.7.2

这是运行命令的结果vagrant up

PS C:\Users\brand_000\Homestead> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 => 8000 (adapter 1)
    default: 443 => 44300 (adapter 1)
    default: 3306 => 33060 (adapter 1)
    default: 5432 => 54320 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.18
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
GuestAdditions versions on your host (4.3.26) and guest (4.3.8) do not match.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.18
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
Reading package lists...
Building dependency tree...
Reading state information...
linux-headers-3.16.0-23-generic is already the newest version.
dkms is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Copy iso file C:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 4.3.8 - guest version is 4.3.8
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.8 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.8 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...done.
Building the shared folder support module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 4.3.8. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/brand_000/Homestead
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device
PS C:\Users\brand_000\Homestead>

这是错误文件的内容。 PasteBin 上传错误文件@/var/log/vboxadd-install.log

我确实按照 StackOverflow 上的一些指南和答案安装了 vbguest vagrant 插件,但到目前为止没有任何效果。甚至尝试将 VirtualBox 降级到 4.3.8 和其他版本,但没有成功。我按照正确安装 Laravel Homestead的说明进行操作。正如我所提到的,它在过去有效。有什么建议么?

4

6 回答 6

2

编辑scripts\homestead.rb,更改:

mount_opts = folder["type"] == "nfs" ? ['actimeo=1'] : []

mount_opts = folder["type"] == "nfs" ? [''] : []

然后安装 VBoxGuestAdditions:

C:\Homestead> vagrant plugin install vagrant-vbguest
C:\Homestead> vagrant up
C:\Homestead> vagrant ssh
$ sudo ln -s /opt/VBoxGuestAdditions-4.3.18/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
$ sudo apt-get install --yes dkms linux-headers-3.16.0-23-generic
$ sudo /etc/init.d/vboxadd setup
$ exit
C:\Homestead> vagrant halt 
C:\Homestead> vagrant up
于 2015-05-11T19:22:40.303 回答
2

这在linux中对我有用,我认为这也可以解决windows中的问题。

Linux 客户机挂载文件夹失败的快速解决方案。

将以下行添加到您的 Homestead/Vagrantfile 中:

config.vbguest.auto_update = false

你的 Homestead/Vagrantfile 应该是这样的:

/...

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

    # To avoid install and uninstall VBoxGuessAdditions during vagrant provisioning.
    config.vbguest.auto_update = false

.../

保存并执行

$ vagrant destroy --force
$ vagrant up
于 2015-09-30T07:53:51.683 回答
1

看起来Laravel docs 5.0仍然是 Homestead 1.x 的指南。但是Laravel docs 4.2已经包含了 Homestead 2.x 的指南。由于laravel/homestead̀ 现在已经在第 2 版上,您最好在此处遵循 4.2 文档。

另一个很好的来源是laracasts homestead 2 介绍

于 2015-05-18T10:15:54.927 回答
1

我解决了与 vagrant up 的输出类似的问题,如下所示:

Installing Virtualbox Guest Additions 5.0.4 - guest version is 4.3.
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.4 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 4.3.14 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)

然后稍后

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

症状

我的 vagrant 脚本已经顺利运行了很长时间,但昨天我更改了磁盘的物理硬件,将磁盘从 lenovo T520 移动到 T530。很好,我不得不更新几个驱动程序。

所以我无法在同一个磁盘上的新硬件上运行我的流浪脚本。

原因

原因是新显卡,NVIDIA 显卡。这张卡有一个GPU处理器,它与计算机上的每个进程挂钩,并尝试检测是否使用GPU。默认情况下,我机器上的 GPU 设置为将 GPU 连接到每个正在运行的进程。

NVIDIA 所做的这种 CPU 挂钩在某种程度上影响了 VirtualBox,VBGuestAdditions 无法正确安装驱动程序,或者至少说缺少某些东西。

解决方案

打开 NVIDIA 控制 => 3D 设置 -> 管理 3D 设置。然后选择“程序设置”选项卡。

现在的诀窍是将VirtualBox.exe添加到下拉框中“1.选择要自定义的程序”,然后将“2.为此程序选择首选图形处理器”设置为“集成图形”

这就是整个把戏。Vagrant up 启动机器并且不会抛出“无法在 linux guest 中挂载文件夹”的消息

在调查了这个程序一整天后,我再次启动并运行。

于 2015-09-16T12:12:47.360 回答
1

只需type: "nfs"从 Homestead.yaml 文件中删除行。

从:

folders:
    - map: ~/Code
      to: /home/vagrant/Code
      type: "nfs"

至:

folders:
    - map: ~/Code
      to: /home/vagrant/Code
于 2017-02-11T21:35:13.497 回答
0

尝试安装VBox Guest Additions以获得文件夹共享支持和VirtualBox Oracle VM VirtualBox Extension Pack以获得对某些设备的额外支持。

使用 Vagrant,您可以运行:

vagrant plugin install vagrant-vbguest
vagrant vbguest

或者手动安装。

于 2016-12-13T14:28:09.897 回答