Thinking Out Loud

February 22, 2020

Create Windows Symlinks to Vagrant Software Folder

Filed under: Vagrant,Windows — mdinh @ 12:45 pm

Most Vagrant implementations have some derivative of software folder with file – put_software_here.txt

It does not make sense to have to copy software to the folder and then to delete afterwards repeatedly for every new Vagrant build.

Luckily, there is a way to create symlinks to a centralized software location.

Start vagrant failed – ERROR: gi_software does not exist because software folder was purposely deleted for demo.
Note: Using Git BASH for Windows.

resetlogs@ghost MINGW64 /g/oracle/vagrant-boxes/OracleFPP (master)
$ ls -l
total 28
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 config/
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 images/
-rw-r--r-- 1 dinh 197121  1896 Feb 22 06:35 LICENSE.txt
-rw-r--r-- 1 dinh 197121 10645 Feb 22 06:35 README.md
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 scripts/
-rw-r--r-- 1 dinh 197121  5449 Feb 22 06:35 THIRD_PARTY_LICENSES.txt
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 userscripts/
-rw-r--r-- 1 dinh 197121 16610 Feb 22 06:45 Vagrantfile

resetlogs@ghost MINGW64 /g/oracle/vagrant-boxes/OracleFPP (master)
$ vagrant up
ERROR: gi_software does not exist

resetlogs@ghost MINGW64 /g/oracle/vagrant-boxes/OracleFPP (master)

Create symlinks from Windows command line.

C:\Windows\System32>mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.

C:\Windows\System32>mklink /J "G:\oracle\vagrant-boxes\OracleFPP\ORCL_software" "E:\ORCL_software"
Junction created for G:\oracle\vagrant-boxes\OracleFPP\ORCL_software <<===>> E:\ORCL_software

C:\Windows\System32>

Read more about it: The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows

Review symlinks and start vagrant successfully:

resetlogs@ghost MINGW64 /g/oracle/vagrant-boxes/OracleFPP (master)
$ ls -l
total 28
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 config/
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 images/
-rw-r--r-- 1 dinh 197121  1896 Feb 22 06:35 LICENSE.txt
lrwxrwxrwx 1 dinh 197121    16 Feb 22 07:05 ORCL_software -> /e/ORCL_software/
-rw-r--r-- 1 dinh 197121 10645 Feb 22 06:35 README.md
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 scripts/
-rw-r--r-- 1 dinh 197121  5449 Feb 22 06:35 THIRD_PARTY_LICENSES.txt
drwxr-xr-x 1 dinh 197121     0 Feb 22 06:35 userscripts/
-rw-r--r-- 1 dinh 197121 16610 Feb 22 06:45 Vagrantfile

resetlogs@ghost MINGW64 /g/oracle/vagrant-boxes/OracleFPP (master)
$ vagrant up
getting Proxy Configuration from Host...
Bringing machine 'host1' up with 'virtualbox' provider...
Bringing machine 'host2' up with 'virtualbox' provider...
==> host1: Importing base box 'ol74'...

1 Comment »

  1. […] I have probably brought this upon myself since I Create Windows Symlinks to Vagrant Software Folder […]

    Pingback by Try, Try, And Try Again | Thinking Out Loud — February 29, 2020 @ 2:12 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

%d bloggers like this: