“Aside” for Mac Users only
Since VMs do sometimes break (for example when the host OS X gets an update) it is not a good idea to save your work
on the VM. Instead, is advisable to store your work either on the Mac's hard drive or on a cloud storage service (e.g. OneDrive, Google Drive or iCloud drive).
If your VirtualBox guest OS is Linux there are no “visibility” issues between the Mac and the Linux VM.
The two machines can share folders through the mechanism provided by Virtual Box.
If your VirtualBox guest OS is Windows, the first option (saving the data on the Mac's hard drive) poses some visibility challenge. Since the Linux account (WSL) has no relationship to the Windows account,
the WSL account does not see the Mac OS Shared Folders provided through the Virtula Box mechanism.
Diversely, MobaXterm does not have any issue to access the Mac OS Shared Folders
(this is because MobaXterm is a Linux emulator not a full Linux System environment)
Accessing WSL files from Windows is also not an issue:
> Network > wsl$ > Ubuntu > home > unixusername
1. How to make a folder on the Mac's hard drive accessible to WSL
a. on the Mac OS
b. on the Mac OS
select System Preferences > Sharing
turn on the File Sharing Service
add the folder you want to share to the list of Shared Folder
add the windows user to the list of Users that can access the Shared Folders
shared folders can be accessed through samba at smb://some_address
c. on the Windows OS
select Explorer > This PC > Computer > Map Network drive
set the drive field to one of the available letters (example U:)
set the folder field to \\some_address\foldername
select reconnect to sign in
d. start the WSL terminal
sudo mkdir -p /mnt/u
sudo mount -t drvfs U: /mnt/u
U: /mnt/u drvfs defaults 0 0
for the unix user (example: utalarico) uid=1000 and gid=1000
for the windows user (example: claudio) uid=1001 and gid=513
to change the ownership of the mounted drive use:
sudo mount -t drvfs U: /mnt/u -o metadata,uid=1000,gid=1000
U: /mnt/u drvfs rw,relatime,uid=1000,gid=1000,case=off 0 0
2. How to access data on a cloud storage service using WSL (example: iCloud)
/mnt/c/Users/<windowsusername>/iCloudDrive/
ln -s /mnt/c/Users/<windowsusername>/iCloudDrive ~/ihome
|