The host has a git repository
/home/meisterluk/repo and has
VirtualBox running a UNIX operating system. We want to provide the git repository as read-only folder to the guest. Test system as host and guest was xubuntu 14.04.
openssh-serveron your host system.
ps aux | grep sshdshould return one line mentioning the running ssh daemon afterwards.
sshfsin your guest operating system.
- Change VirtualBox’s
Configuration > Network > Adapter 1from
Attached to: NATto
Attached to: Bridged Adapter.
Name: wlan0works for me because I am using the wlan0 device to connect to the internet.
- Ask for the ip address of your host network device via
ip a. For me this is
sshfs [host operating system username]@[IP address]:[repository path on host system] [mount point] -o allow_other,uid=33,gid=33
sshfs firstname.lastname@example.org:/home/meisterluk/repo /var/www/html/repo -o allow_other,uid=33,gid=33
where 33 is the uid and gid of the user
www-data. In order to set
allow_otherI had to uncomment the line
If you savestate the VirtualBox instance and continue again, you need to remount it again (because apparently the SSH session stopped). You can always umount the sshfs using
sudo fusermount -u /var/www/html/repo.
Credits go to LSPE for his hints. Thanks!