So I have a project that requires a specific (and modified) version of the jdk, which I am given as a tar.gz
.
I'm running a Kubuntu 17.04 in VirtualBox as a guest OS on a Windows 10 host, because the single disk of my laptop has too many partitions to set up dual boot on it.
To save space and to avoid having to move files from the guest to the host or vice versa, I have created a shared folder where I keep most my stuff, and it is within that folder that I tried to extract the jdk.
sudo tar xzf jdk-7u65-linux-x64.tar.gz
tar: jdk1.7.0_65/bin/ControlPanel: Cannot create symlink to ‘jcontrol’: Read-only file system
tar: jdk1.7.0_65/man/ja: Cannot create symlink to ‘ja_JP.UTF-8’: Read-only file system
tar: jdk1.7.0_65/jre/bin/ControlPanel: Cannot create symlink to ‘jcontrol’: Read-only file system
tar: jdk1.7.0_65/jre/lib/amd64/server/libjsig.so: Cannot create symlink to ‘../libjsig.so’: Read-only file system
tar: Exiting with failure status due to previous errors
I'm also getting these errors when I try to unzip the tarball with WinRAR on the host end unless I run WinRAR as an administrator. Still I don't really like doing it that way because I have no idea if extraction using WinRAR in Windows would do anything wrong to some files for use in Linux.
Is there a way to make this work from the Linux guest system? And if not, why not?
Permissions:
user@linux-VB:~$ namei -l ~/SHRD_FLDR
f: /home/user/SHRD_FLDR
drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-xr-x user user user
lrwxrwxrwx user user SHRD_FLDR -> /media/sf_SHRD_FLDR/
drwxr-xr-x root root /
drwxr-xr-x root root media
drwxrwx--- root vboxsf sf_SHRD_FLDR
Make sure all VMs, as well as the VirtualBox GUI are closed.
Go to where VirtualBox is installed.
In my case, that's
C:\Program Files\Oracle\VirtualBox
.There, execute command
Where VM_NAME is the name you've given the VirtualBox VM and SHARED_NAME is the name you've given the shared folder when you set it up.
E.g. if I have a Virtual machine named
Linux
, for which I've set up a shared folderSHARED
that I can access with~/SHARED
from within the guest, the command will beDespite this command -- and the way I understand it, depending on your windows version -- you may additionally have to run VirtualBox as administrator to be able to create symlinks.
Tested with Virtualbox
Version 5.1.22 r115126 (Qt5.6.2)
.Adding to the last bit of the answer from User1291, at the time of writing all versions of VirtualBox (including the latest, 6.1.32) lack the ability to create symlinks without elevation (i.e. 'Run as Administrator') or other special privileges on a Windows 10 host, because VirtualBox's underlying call to the Windows
CreateSymbolicLink
function do not include theSYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
flag.If VirtualBox ticket #18680 gets fixed, then as per this explanation from Microsoft you will just need to enable the Windows 10 "Developer Mode" and not use 'Run as Administrator' anymore.
A deeper discussion of this began here.