Skip to content
NYC Tech Tips

NYC Tech Tips

Tech Tips From a NYC System Administrator

  • Home
  • About
  • Downloads
  • JB Network Design
  • Toggle search form

Share a Folder between Host OS and Guest OS in Virtual Box (Windows > Linux Mint)

Posted on June 8, 2020July 17, 2020 By ninjatechnyc

I use Linux Mint on Windows using Virtual Box, mainly to use as a sandboxed OS for security testing email attachments, links, and websites.  Easy to take a snapshot and revert if I fubar it. I wanted to create a shared folder between host Operating System and Guest Operating system so i can pass along files, links, etc. In this case, my host OS is Windows and my guest OS is Linux Mint. These steps will most likely work with any version of Linux.

Install Guest Additions if it is not already installed:

1 – With Linux Mint running, from the Virtualbox menu, go into Devices > Insert Guest Additions CD image

 

2 – This should mount the image as a virtual CD. Double-click on the CD to open the folder

 

3 – Right-click in an empty space of the folder and select Open in Terminal

 

 

4 – Install the Virtual Box Guest Additions by running the following command in the Terminal window:

$ sudo ./VBoxLinuxAdditions.run

5 – Reboot your Linux guest

 

Create Shared Folder in Windows

1 – Identify a folder in Windows that you want to share (or create a new one)

2 – In Virtual Box, go to Devices> Shared Folders> Shared Folders Settings…

 

3 – Click the Add Shared Folder button

4 – Enter the path to the folder you want share, give it a name, select Auto-Mount, and if necessary Make Permanent

 

 

Mount the folder in Mint

1 – Create a folder in Mint that will share files with the host Windows OS. In my example I create a folder on the desktop called Shared. Open a Terminal and enter the following:

$ sudo mkdir ~/Desktop/Shared

2 – Mount the shared folder. In the Terminal window, enter the following:

$ sudo mount -t vboxsf Mint ~/Desktop/Shared

where Mint is the folder we’re sharing in the host Windows OS and Shared is the folder in the guest Linux Mint OS.

At this point you should be able to share files between the host and guest. However, if you reboot the guest, the above mount would need to be redone.  Instead, what I’d like to do is create two shortcuts on the Linux Mint Desktop that I can double-click to mount or unmount the share.

 

Create Shell Scripts to Mount and Unmount the folders

1 – Open Nemo (or Nautilus, depending on your flavor of Linux) as sudo using Terminal:

$ sudo nemo

2 – Navigate to the /bin folder, right-click and Create an Empty Document and call it MountShared.sh (or call it whatever you want but use the .sh extension)

 

 

3 – Double-click the file to open it in a editor, enter the above mount command (shown again below):

$ sudo mount -t vboxsf Mint ~/Desktop/Shared

4 – Save and close the file

5 – Right-click on the MountShared.sh file and select Properties

6 – Under the Permissions tab, check  the Execute option Allow executing file as a program and close

 

 

7 – Create another Empty Document in the /bin folder and call it UnMountShared.sh

8 – Double-click this file to open in an editor and enter the following unmount command:

$ sudo umount -t vboxsf Mint ~/Desktop/Shared

9 – Save and close the file

10 – Right-click on the UnMountShared.sh file and select Properties

11 – As above, under the Permissions tab, check  the Execute option Allow executing file as a program and close

 

Create Desktop Shortcuts for the Shell Scripts

1 – Right-click on an empty space on your Desktop and select Create a new Launcher here…

2 – Name the shortcut. I called it Mount_Shared

3 – For the Command, browse to /bin folder and select the MountShared.sh script you created.

4 – Check the Launch in Terminal?  option and then OK

 

 

10 – Repeat the above 9 steps to create the UnMountShared.sh shortcut

Now you should be able to double-click the Desktop shortcuts to mount and unmount your shared folder

 

Optional – Change Shortcut Icon

1 – Right-click the shortcut your created on the Desktop and select Open With> Other Application, and select Text Editor

2 – In the Text Editor, add the following Icon option and specify the name of the icon file, including the path.  For example,

Icon=/usr/share/icons/Mint-X-Orange/places/128/stock_folder.svg

3 – Save the file, and the icon should change.

 

That’s it!

 

 

 

 

linux, tech, tech tips, windows Tags:Linux Mint, shared folder, Virtual Box

Post navigation

Previous Post: jQuery for WordPress Update
Next Post: Don’t Click On That Link! | Avoid Becoming a Phishing Victim

Search

Tags

adobe Amazon antispyware antivirus apache Apple AT&T blackberry browser China computer data breach Dell dilbert dogbert email encryption facebook faulting application FB firefox firewall flash drives freeware godaddy google Hack Identity Theft Internet Explorer iPhone linux malware Microsoft paypal phishing privacy recommended reading scam security software tech support ubuntu virus windows Wordpress

Archives

  • April 2021
  • September 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • June 2017
  • May 2017
  • December 2016
  • November 2015
  • June 2015
  • June 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • September 2011
  • July 2011
  • May 2011
  • April 2011
  • March 2011
  • January 2011
  • December 2010
  • October 2010
  • August 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • December 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • February 2009
  • December 2008
  • November 2008
  • October 2008
  • July 2008
  • June 2008
  • April 2008
  • March 2008
  • January 2008

Copyright © 2021 NYC Tech Tips

Powered by PressBook Dark WordPress theme