I found a way! In a nutshell, we mount an SMB share from the Mac inside of Windows (WSL) bash.
My setup:
- macOS 10.14.2
- Parallels 14.1.0 Pro
- Windows 10 Version 1803 (build 17134.472)
- WSL bash is Ubuntu 18.04.1 LTS (Bionic Beaver).
Enable SMB sharing on the Mac host
- Open System Preferences.
- Go to Sharing.
- In the leftmost menu, enable File Sharing and click on it.
- Click the Options... button on the right.
- Check Share files and folders using SMB.
- In the menu, enable your user name.
- You may be warned that your password will be stored in a less secure manner. Put in your Mac account password and click OK.
Enable the Parallels Host-Only network
- Open Parallels.
- Hit
Cmd-,
to open the preferences.
- Open the Network tab.
- Select Host-Only in the left menu.
- Check "Connect Mac to this network".
- Open Mac system preferences.
- Click on Network.
- In the left menu with your devices, click the one that says "Parallels Host-Only #1" or similar. (If it's too long to see completely in the menu, you can check that you have the right one after you've clicked on it. Under "Status: Connected", in small text, there is a sentence that says "Parallels Host-Only #1 is currently active and has the IP address 10.37.129.2.")
- Remember the value in the IP Address field. You can keep this window open.
Connect to the SMB share from Windows
- Once Windows 10 has booted, open a Windows Explorer window.
- In the left pane, right-click Network, and choose Map Network Drive.
- Choose an available drive letter. I'll use Y:.
- This next step will result in an error at first, but that is ok. Type in
\\
followed by your IP address, and hit enter.
- Dismiss the error dialog.
- Click Browse...
- The IP should appear in the list. Expand it.
- Type in your Mac username and password.
- Choose a folder to mount and click OK. I chose my user folder.
- Click Finish.
Mount the SMB share from WSL bash
sudo mkdir /mnt/y
(You can use whatever drive letter you chose earlier.)
sudo mount -t drvfs Y: /mnt/y
- That's it! You are done!
Optional: Verify RW access to the SMB share
This section is optional, but is a nice sanity check.
- The WSL bash prompt should be open.
ls -l
(You should see your files now. Don't worry that everything is owned by root. You can still write to the mounted share without sudo
, and things will be owned by your user on the Mac side.)
echo hello > hi.txt
- On the Mac, open a Terminal window.
- cd into the directory containing your hi.txt file.
cat hi.txt
(You should see "hello".)
echo world > hi.txt
- Switch back to WSL bash.
cat hi.txt
(You should see "world".)
Caveats
I realize that the password issue is suboptimal. I went this route because attempting to mount the regular Parallels-shared Mac folder didn't work. Here is what happened:
$ sudo mkdir /mnt/y
$ sudo mount -t drvfs '\\Mac\Home' /mnt/y
$ cd /mnt/y
$ ls
ls: reading directory '.': Invalid argument
$ cd ..
$ sudo umount /mnt/y
$ sudo mount -t drvfs Z: /mnt/y
$ cd y
$ ls
ls: reading directory '.': Invalid argument
It looks like WSL and Parallels aren't working so nicely together, so I sidestepped Parallels a bit. I wish I didn't have to, and I'd love to see a better solution.