Previous journal: | Next journal: |
---|---|
0058-2020-08-11.md | 0060-2022-11-23.md |
A long time since my last entry.
I was going to try this tutorial on Three.js.
This tutorial uses Node.js, and for that I've set up an Ubuntu 20.04 LTS VirtualBox VM on my Win10 host. I'll use it for this sort of dev stuff that just tends to be better on Linux than Windows.
- The VM is called
UbuntuServer20
. - Its internal hostname is
vmubuntu20
. - It's using bridged networking with a reserved DHCP IP:
10.1.1.123
- User is
user
. Password is my dummy one, but I also have an SSH key authorised (ed25519-key-20220328
).
I'm using a host share again, this time in D:\Projects
, and I forgot about how much Node.js packages use symlinks. These
don't work by default in VBox host shares, and it leads to EROFS
and Operation not permitted
errors, and other cascading
failures.
I last came across this here.
At the time it was necessary with VBox to "Run as Administrator", and it looks like it still is. A non-admin Win10 user can apparently create symlinks so long as "Developer Mode" is turned on in Settings, but it does depend on the internal API call using an extra parameter. VirtualBox hasn't implemented that. For more info see this and this. Evidence of the VirtualBox flag being right, but Win10 not allowing it, looks like a different error:
ln: failed to create symbolic link './test.txt': Protocol error
OK, so I guess we still need to "Run as Administrator".
Anyway, I did this with my VM:
- Rolled back the state of my VM to a known good state (since I'd tried installing some Node.js stuff and it broke). It's easier to roll back than it is to limp along with the environment in an unknown state.
- Got the Shared Folder name:
Projects
- Shut down all VMs then quit the VBox UI. Wait maybe a minute for the service to properly shut itself down.
- Ran this in Command Prompt:
VBoxManage setextradata UbuntuServer20 VBoxInternal2/SharedFoldersEnableSymlinksCreate/Projects 1
- Launched VBox again and started the VM.
In the VM, ~/Projects
is a symlink to /media/sf_Projects
(auto-mount enabled) which is my host's D:\Projects
.
Note that this doesn't seem to come online for at least 10 seconds after the VM is ready for SSH access.