Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/sbin/mount.vboxsf: mounting failed with the error: No such device #8303

Closed
phpapi opened this issue Feb 25, 2017 · 1 comment
Closed

/sbin/mount.vboxsf: mounting failed with the error: No such device #8303

phpapi opened this issue Feb 25, 2017 · 1 comment

Comments

@phpapi
Copy link

phpapi commented Feb 25, 2017

Vagrant version

Vagrant 1.9.1

c:\www\htdocs\vagrant>vagrant plugin list
vagrant-share (1.1.6, system)
vagrant-vbguest (0.13.0)

Host operating system

Win10

Guest operating system

VirtualBox 5.0.24 r108355

CentOS Linux release 7.3.1611 (Core)(after run yum update)
Kernel 3.10.0-514.6.2.el7.x86_64

Vagrantfile

Vagrant.configure(2) do |config|
  config.vm.box = "CentOS-7-Vagrant-1505-x86_64-01"

  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
   config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder ".", "/home/vagrant/sync", type: "virtualbox"

    config.vm.provision "shell", inline: <<-SHELL
  SHELL
end

Actual behavior

c:\www\htdocs\vagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> 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 (guest) => 8080 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> 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: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
[default] GuestAdditions versions on your host (5.0.24) and guest (4.2.10) do not match.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
Package kernel-devel-3.10.0-514.6.2.el7.x86_64 already installed and latest version
Package gcc-4.8.5-11.el7.x86_64 already installed and latest version
Package binutils-2.25.1-22.base.el7.x86_64 already installed and latest version
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Package 4:perl-5.16.3-291.el7.x86_64 already installed and latest version
Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version
Nothing to do
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.2.10 - guest version is 4.2.10
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.10 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.2.10 of VirtualBox Guest Additions...
                                                     Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[  OK  ]
Building the shared folder support module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]
Installing the Window System drivers[FAILED]
(Could not find the X.Org or XFree86 Window System.)

==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 4.2.10
    default: VirtualBox Version: 5.0
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /home/vagrant/sync => C:/www/htdocs/vagrant
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 home_vagrant_sync /home/vagrant/sync

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

Network question, I got this output in the machine image

[root@localhost ~]# service network restart
Restarting network (via systemctl):  Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
                                                           [FAILED]
[root@localhost ~]# systemctl status network.service
● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2017-02-25 00:25:03 EST; 1min 20s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 16813 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Feb 25 00:25:03 nodename.domainname network[16813]: [  OK  ]
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
Feb 25 00:25:03 nodename.domainname network[16813]: RTNETLINK answers: File exists
[root@localhost ~]# ifconfig -a
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:73:0f:b1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.33.10  netmask 255.255.255.0  broadcast 192.168.33.255
        inet6 fe80::a00:27ff:fe34:7557  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:34:75:57  txqueuelen 1000  (Ethernet)
        RX packets 2063  bytes 724832 (707.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1089  bytes 278076 (271.5 KiB)
        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 1  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

install VBoxGuestAdditions_5.0.2

[root@localhost vagrant]# sudo mount -o loop,ro VBoxGuestAdditions_5.0.2.iso /media/VBoxGuestAdditions
[root@localhost vagrant]# sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run rm VBoxGuestAdditions_5.0.2.iso
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.2 Guest Additions for Linux............
VirtualBox Guest Additions installer
Please specify an absolute path

Usage: /media/VBoxGuestAdditions/VBoxLinuxAdditions.run install [<installation directory>]
       [--with-<module>] |
       uninstall
       [--force] [--no-setup]

Example:
/media/VBoxGuestAdditions/VBoxLinuxAdditions.run install
[root@localhost vagrant]# sudo umount /media/VBoxGuestAdditions
[root@localhost vagrant]# sudo rmdir /media/VBoxGuestAdditions
[root@localhost vagrant]# sudo /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module                   [  OK  ]
Building the shared folder support module                  [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions              [  OK  ]
[root@localhost vagrant]# vi /var/log/vboxadd-install.log
@chrisroberts
Copy link
Member

Hi! The problem here is that the guest additions failed to build the shared folder module as seen in the output here:

Building the shared folder support module[FAILED]

Proper installation of guest additions within the box will resolve the synced folder issue.

The private network interface issue you are encountering was fixed by this PR #8148 and is release in version 1.9.2.

Cheers!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants