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

/vagrant doesn't exist, read-only? #55

Open
adamwolf opened this issue Apr 16, 2020 · 7 comments
Open

/vagrant doesn't exist, read-only? #55

adamwolf opened this issue Apr 16, 2020 · 7 comments

Comments

@adamwolf
Copy link

I created a 10.15.2 box the other day with this tool, and today I tried to setup rsync-based /vagrant sharing like I had with other tools on 10.14 et al.

I have the following in my Vagrantfile.

  config.vm.synced_folder ".", "/vagrant", type: "rsync"

At boot, I get

==> default: Rsyncing folder: /Users/wolf/tmp/catalinatest/kicad-mac-builder/ci/10.15/ => /vagrant
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p /vagrant

Stdout from the command:



Stderr from the command:

mkdir: /vagrant: Read-only file system

What's the right approach here? Disable SIP and create it and save? Should I use synthetic.conf?

@adamwolf
Copy link
Author

I think that for NFS, we would want /etc/synthetic to just have

vagrant

For rsync, I did this

mkdir ~/vagrant_root
sudo su -c 'echo "vagrant\tUsers/vagrant/vagrant_root" >> /etc/synthetic.conf'
reboot

and it came up ok.

@bacongravy
Copy link
Owner

bacongravy commented Apr 16, 2020

@adamwolf I don’t use a workflow that relies on /vagrant so I haven’t encountered this before. I believe it might be possible to create /vagrant as part of a macinbox user script that runs during box creation, but I’m not sure that newly created directory would be any more writable than / once the system booted. I don’t know how it would impact rsync, but another approach to try would be to create, in a user script during box creation, a symlink at /vagrant that points to a non-SIP-protected location.

@adamwolf
Copy link
Author

adamwolf commented Jul 8, 2020

It seems supported to me? man synthetic.conf on a 10.15 or higher machine.

On a pragmatic level, I created a directory in root's homedir and made a "synthetic firmlink" to it from /vagrant using synthetic.conf, and it's worked for me for few months so far.

@yeahdongcn
Copy link

/etc/synthetic.conf works well.

On macOS 10.15, you could use sudo mount -uw / to make / writable (doesn't work on Big Sur).

@clusin
Copy link

clusin commented Jul 11, 2020

Deleted my previous post cuz I didn't read @adamwolf initial post carefully 😬

I followed the suggestions here and added my root directory name to /etc/synthetic.conf. My /etc/synthetic.conf file looks like:
<foldername>

For the synced folder I went the NFS route. I I'm trying to keep my box slim on disk space and degraded performance of nfs mount is okay for me. Using VirtualBox as the provider my final Vagrantfile looks like:

  config.vm.network "private_network", ip: "192.168.10.100"
  config.vm.network "public_network", ip: "192.168.20.200", bridge: "en1: Wi-Fi (AirPort)"
  config.vm.synced_folder "./Deployment/dev/", "/<foldername>", type: "nfs"

VirtualBox needed a host-only network interface setup to get NFS mounts working. Some hero on Stack Overflow suggested picking random unoccupied private IP addresses for the two interfaces. This worked for me to get macinbox up and running w/ Virtual Box running Catalina.

Thank you all.

@bacongravy
Copy link
Owner

bacongravy commented Jul 14, 2020

To support the default rsync case, perhaps we should update macinbox to create a synthetic.conf in the VM image and add an entry to it like this:

vagrant     var/root/vagrant

@mcandre
Copy link

mcandre commented Nov 24, 2020

This appears to work for me:

% sudo sh -c "echo \"vagrant\\tUsers/vagrant/vagrant_root\" >>/etc/synthetic.conf"
% mkdir -p /Users/vagrant/vagrant_root

Maybe the /var/root/vagrant version of this just needs a similar mkdir -p done during provisioning to work, I dunno. But I get an I/O error that way, which is really just hiding a permission error. At least with the kishikawakatsumi/macos-catalina-xcode12 box on Vagrant Cloud (one of the few, uncorrupt, boxes available with a sufficiently recent patch level of macOS to satisfy Xcode 12 requirements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants