How to create a shared folder between host Operating System and Guest Operating system?
This is the scenario that you run Windows as your host operating system and Ubuntu in a VirtualBox, and that you want to access a specific Windows folder from Ubuntu.
Share a folder between Host OS-> Windows and Guest OS ->Ubuntu(Virtual box)
Install install Guest Additions from VirtualBox’s menu go to Devices->Install Guest Additions
This will mount a virtual CD on your /media/cdrom. As root user Open this /media/cdrom added folder using Open with terminal option(Right click with mouse).
Run the program VBoxLinuxAdditions.run. When the program completes reboot your VirtualBox.
$ sudo ./VBoxLinuxAdditions.run
Create a shared folder. From Virtual menu go to Devices->Shared Folders then add a new folder in the list, this folder should be the one in windows which you want to share with Ubuntu(Guest OS).
Make this created folder auto-mount.
Example -> Make a folder on Desktop with name Ubuntushare and add this folder.
When done with you shared folder(s) specification, we mount folder from Ubuntu(Guest OS).
Create a mountpoint, this a directory in Ubuntu that will share files with the shared folder from Windows.
Run this to create a directory in Ubuntu
$ sudo mkdir ~/Desktop/windowsshare
With your mountpoint created you can now mount the shared folder.
Run this command to share the folder:
$ sudo mount -t vboxsf Ubuntushare ~/Desktop/windowsshare
Ubuntushare is the name of folder we add in VirtualBox Devices section this folder is in Windows(Host OS).
~/Desktop/windowsshare is the directory in Ubuntu(Guest OS)
Now you can share the files between Windows and Ubuntu. Try adding any file in windows(Host OS) Ubuntu share folder now check Ubuntu(Guest OS) windowsshare directory the file will be reflected.
This article is contributed by SHAURYA UPPAL. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- How to create a Shared Folder between two Local User in Linux?
- How to create a Folder without any name and icon in Windows OS?
- Create Directory or Folder with C/C++ Program
- Using mkvirtualenv to create new Virtual Environment - Python
- Create a Virtual Machine and Set up API on Google Cloud
- POSIX shared-memory API
- How to rename all files of a folder using Java?
- host command in Linux with examples
- Chat application between two processes using signals and shared memory
- Social Engineering - The Art of Virtual Exploitation
- Virtual Machine for Malware Analysis
- Hackathon - Think, Code, Create
- How to create a Class in JShell of Java 9
- How To Create a Temporary Email Address?
- How to Create and Configure Wi-Fi Hotspot in Windows 10?
- How to create and deploy your portfolio in under 10 minutes
- Create a password generator using shell scripting
- How to Create Partitions of a Hard Drive in Windows 10?
- How to Create a Bootable Pendrive using cmd(command-prompt)?
- How to Create Reverse Shells with Netcat in Kali Linux?
Improved By : arnab1729