Sunday, November 8, 2015

How to permanently mount folder in CentOS home directory with Ubuntu host shared folder in Virtualbox .


  In this post, I'm going to share on  How to  permanently mount folder in CentOS home directory with Ubuntu host shared folder in Virtualbox .

 If you want to mount folder in CentOS home temporarily, please visit my previous post .


What this tutorial will cover 

  1. Create a folder to  shareand configure Virtualbox in Ubuntu host .
  2. Create a folder to mount in CentOS home folder .
  3. Configure CentOS fstab file .

Steps

1) Create a folder to share and configure Virtualbox in  Ubuntu host.

1.1) Create a shared folder in Ubuntu host system.

Create a folder 

I named the folder "CentOS_shared" .
CentOS shared folder


1.2) Open Virtualbox ,go to  "Settings> Shared folders" . Add the newly created folder in Step 1.1 . Click the "blue plus" sign to look for the folder .

Add  the created folder in Virtualbox
Look for folder location


1.3) Choose the folder and click "Open" .

Choose the folder

1.4) Click "Auto-Mount"  box.




1.5) Click "OK" .


1.6) Run  CentOS in Virtualbox. By clicking the "Start" button .




Note: By default, once you share the folder in virtualbox,you can access this folder in CentOS under  "/media" location .

2) Create a folder in CentOS home folder .


2.1) Create a folder  in CentOS home folder . In this example, i create a folder name "Ubuntu_shared" .
Create a new folder in  CentOS home folder

Ubuntu_Shared
/media/sf_CentOS_shared











3. Configure CentOS "fstab" file .

3.1) Open the fstab file .




3.2) Edit "fstab" file .

In the file, add below line .



You need to configure the "fstab" file base on what you configure in your system. Below is my CentOS system path and directory details .

/media/sf_CentOS_shared =(Ubuntu shared folder under /media ) 
/home/orca/Ubuntu_shared =(home directory share folder)




3.3)  Save the configuration and reboot your system.
Once rebooted,Ubuntu host shared folder should be mounted automatically and permanently with CentOS folder in home directory .