How to fix virtualbox unknown filesystem type 'vbox' - linux

I want to make a virtual machine for web development on archlinux guest that acts like vagrant box. I don't want to use vagrant box because I want to learn how to do things on my own first and I want to keep the disk space used by the machine at minimum as possible. For this I have installed and configured apache2, php, mariadb with a total of 640M used on disk. I have forwarded guest 80 port to host 127.0.0.1:8080.
I encounter an error with the vboxfs module, I have installed virtualbox-guest-module as described here and after a machine reboot tried:
mount -t vboxfs share_name mount_location and I get this error unknown filesystem type 'vbox'.
I have searched google and all the results make reference to the virtualbox-guest-utils from archlinux but the problem is I don't need all the dependencies that package has (alsa, xorg, video driver etc.) and I don't know witch deps I need or I don't need from that package... so I wander if it is possible and it is enough to use just the vboxfs module to be able to use the share functionality from Virtualbox.

You made a typo. It should be vboxsf instead of vboxfs. I did the same and was wondering why it doesn't work. So the full command is:
sudo mount -t vboxsf share_name mount_location
To remember the correct type you can think of it as the abbreviation of VirtualBox Shared Folder.

Related

WSL2 "read-only" file system while building chromium

I'm attempting to build chromium on WSL2 according to this guide.
When I get to the fetch --nohooks chromium everything is loading and then I get the following error:
OSError: [Errno 30] Read-only file system: '/home/ghadar/chromium/src/third_party/libprotobuf-mutator/_gclient_src_0ve3yqhz'
I've looked everywhere and couldn't find any explanation to this error.
I'm running WSL2 on Windows 11 with Ubuntu 20.04 as the Linux distribution.
A few possibilities that I can think of:
Filesystem corruption (it happens)
Out of disk space on the host Windows drive
For the first one, see #6220 on the WSL Github. Recommended solution is (and it might be a good idea to backup any critical files first):
# Identify the correct drive:
mount | grep ext4
# Take the drive returned (e.g. /dev/sdd) and:
sudo e2fsck /dev/sdd -p
It could also be a disk-space issue. The Chromium source is pretty large at around 57GB. Is it possible that you are out of disk space on the Windows drive? If so, then WSL still thinks it has space remaining, because it is on a sparse virtual disk that can grow up to (250GB/1TB depending on the WSL release), but once space on the host drive is gone, WSL probably set the device read-only.
If that's the case, and you have a larger drive (SSD/NVMe recommended for performance, of course), you can "move" the virtual disk if you'd like -- See my Super User answer on the topic.
Or you might try fetching without the full repo history, as suggested in the docs, with the --no-history flag.

How to get Vagrant Homestead to boot using Hyper-V

I was unable to get homestead to boot using the directions provided here https://laravel.com/docs/5.7/homestead using hyper-V. The original issue was that the machine would not boot it would just hang indefinitely. Once I fixed this issue I encountered 2 more before I was able complete the vagrant up command.
I am not 100% sure this is the right place to post this but I have spent about 2 weeks off and on trying to solve this issue and hopefully I can save someone else a little time if they have similar issues. I was able to use homestead using virtual-box but it was extremely inconvenient to not have Hyper-V running on my PC so I uninstalled virtual-box and tried to setup homestead using Hyper-V. For me the VM would not boot at all. When I looked at it in Hyper-V manager it was just hung at startup. This turned out to be that it is setup as generation 1 box with the drive connected as IDE. For me the solution was to create a new generation 2 VM and connect the provided drive using SCSI. I then disabled secure boot and I was able to boot. Then it failed during the provisioning script trying to mount the default vagrant share. I could not figure out how to modify this call so ended up disabling it as for homestead it is not needed as far as I can tell. Then my third issue was not being able to mount any of the user defined shares in the homestead.yaml file. Some googling on this showed that I needed to make this call with no additional paramters which the script did not seem to provide an option to do. I modified the script and whola the vagrant up command completed successfully. Below are the details of the steps I took. If there is a simpler way to get Vagrant Homestead running using Hyper-V I would appreciate the advice.
Issue 1: Will not boot
Description: The issue seems to be that is trying to boot as a Generation 1 using the IDE controller. This does not seem work for my installation of windows 10 Pro.
Resolution:
1. Created a new VM using Generation 2 and attached the existing
"ubuntu-18.04-amd64.vhdx" to it using SCSI.
2. Boot this VM and then shutdown.
3. Turn off secure boot
4. Replace the Virtual machine files in [VagrantInstallFolder]\boxes\laravel-VAGRANTSLASH-homestead\6.4.0\hyperv with the new ones created above.
5. Delete newly created box from HyperV
Issue 2: Will not mount default Vagrant share
Error Message:
==> homestead-7: Machine booted and ready!
No valid IDs were given to the NFS synced folder implementation to
prune. This is an internal bug with Vagrant and an issue should be
filed.
Description: The vagrant up command fails at the attempt to mount the default vagrant share. I found no way to override the parameters for this call so it was always trying to make the call using nfs which is not supported on Windows. If it is possible to override this call settings then that would be the preferable way. But the only way I could figure out to get the provisioning script to continue to execute is to disable this share.
Resolution:
1. Modify the scripts\homestead.rb file and add the code below to the
Hyper V config settings section "Configure A Few Hyper-V Settings". This
will disable the default file share but you can still add your own from
the homestead.yaml file after completion of issue 3.
#Disable the default Vagrant file share
config.vm.synced_folder ".", "/vagrant", disabled: true
Issue 3: User defined shares in the homestead.yaml file still error.
Error Message:
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 cifs -o vers=3,credentials=/etc/smb_creds_vgt-96269f65d23acb279735d26264428995-66f0bd5cbca4d218f5f0b8a5f1712727,uid=1000,gid=1000,nolock,udp,noatime //192.168.1.107/vgt-96269f65d23acb279735d26264428995-66f0bd5cbca4d218f5f0b8a5f1712727 /home/vagrant/code
The error output from the last command was:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Description: The vagrant up command fails at the attempt to mount the user defined shares in the homestead.yaml file. The mount seems to be passing unneeded parameters to the mount command. We need to override the mount call in the scripts\homestead.rb file to use no parameters.
Resolution:
1. In the "Register All Of The Configured Shared Folders" section replace the line below.
Replace
config.vm.synced_folder folder['map'], folder['to'], type: folder['type'] ||= nil, **options
With
config.vm.synced_folder folder['map'], folder['to'], type: "smb"
2. Then run "vagrant up --provider hyperv"
What Vagrant Plugins are installed (vagrant plugin list)?
I was getting the following error:
No valid IDs were given to the NFS synced folder implementation to prune. This is an internal bug with Vagrant and an issue should be filed.
Previously, I'd been using NFS and had the following plugin installed: https://github.com/winnfsd/vagrant-winnfsd.
Once I removed the plugin via vagrant plugin uninstall vagrant-winnfsd, provisioning worked.
I had the same issue on windows 11 and i found something that might help you
Open Hyper-V Manager on windows
You'll find the VM created by the vagrant up command
Run it from the Manager and login into ubuntu VM
Try vagrant up command again inside your project folder
It should work now!
I hope this help you.

Install/Update cifs-utils before mount smb

I'm currently trying to get Vagrant to provision a working CentoOS7 image on Windows10, using Hyper-V. Vagrant 1.8.4, current latest.
I envcounter a problem where the provisioning fails and I need to workaround each time. The CentOS7 image is a minimal image and does not include cifs-utils, therefore the mount wont work. So, I need cifs-utils installed before mount.
Error:
==> default: Mounting SMB shared folders...
default: C:/Programs/vagrant_stuff/centos7 => /vagrant
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 cifs -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,sec=ntlm,credentials=/etc/smb_creds_4d99b2
d500a1bcb656d5a1c481a47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant
mount -t cifs -o uid=`id -u vagrant`,gid=`id -g vagrant`,sec=ntlm,credentials=/etc/smb_creds_4d99b2d500a1bcb656d5a1c481a
47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant
The error output from the last command was:
mount: wrong fs type, bad option, bad superblock on //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
As it is now, the provisioning has to fail, and I need to:
vagrant ssh (powershell)
(connect to instance via putty/ssh)
sudo yum install cifs-utils -y (putty/ssh)
(wait for install...)
exit (putty/ssh)
vagrant reload --provision (powershell)
This is obviously a pain and I am trying to streamline the process.
Does anyone know a better way?
You can install the missing package in your box and repackage this box so you can distribute a new version of this box containing the missing package.
In order to provision a vagrant box you need to create it from an iso. While preparing the box you can install all needed packages for you. In your case it is Hyper-v - https://www.vagrantup.com/docs/hyperv/boxes.html
Best Regards
Apparently my original question was downvoted for some reason. #whatever
As I mentioned in one of the comments above:
I managed to repackage and upload an updated version. Thanks for the advice. Its available in Atlas as "KptnKMan/bluefhypervalphacentos7repack".
Special thanks to #frédéric-henri :)

Vagrant never finishes `up`

I'm attempting to package an existing VirtualBox VM for our dev team to easily distribute and use. Given the box is already set up, I installed the VirtualBox Guest Additions.
The problem is that after I package the box and add it to Vagrant, I run vagrant up and everything seems to work fine, until it gets to:
==> default: Mounting shared folders...
default: /vagrant => /Users/alex/vagrant/centos7
At this point, it just hangs. No issue. It didn't give any errors when checking for guest additions in VM either.
Also, if I add any network config to my Vagrantfile (config.vm.network "public_network") it will hang at this point instead (==> default: Configuring and enabling network interfaces...)
Really no idea where to go from here. Thanks in advance for any help.
It may happen if the guest addition version is different on the host and the vm. At this point, the folders may not be mounted but your vm should be up. Use <Ctrl + C> to come out of the script execution and then do vagrant ssh. Please make sure to install the correct guest additions version in the box and repackage.

Share folder from Host to Guest VM using KVM

I want to share a folder from the host (linux) to a Linux VM that is running on it.
After some research I used 9p (version = 9p2000.L) sharing, following instructions given on the link below:
http://www.linux-kvm.org/page/9p_virtio
PROBLEM: I am unable to read/write to the mounted folder.
mount command shows the mounted fs as : 9p (rw,trans=virtio,version=9p2000.L)
Even doing a simple "ls" command after entering the mount point says : Permission Denied.
Any help is appreciated
Looks like the 9p kernel module is broken in some kernels (3.5, 3.11). I ungraded by guest to 3.10.9 and things started working! :)
I just went with a hunch and have no bug reports or anything to share. Now when I googled it,I see there are few other facing the similar problem and have solved it in a similar fashion.
https://bugs.archlinux.org/task/36992
-HTH

Resources