Saturday 9 June 2012

Sharing files from Virtualbox Linux VM to Windows and Vice Versa

Let's say you have a windows OS on which you are running Virtualbox with a redhat guest OS and you want share files from windows to your VM and vice-versa.

1. Create a share file on windows(called mine WINDOWSSHAREFOLDER)

2. Create a share file on your VM(called mine VMSHAREFOLDER)

3. Install VboxLinuxAdditions on your VM by mounting the iso for VboxLinuxAdditions(it is found in the directorectory where you installed virtualbox: Program Files\Oracle\VirtualBox\) on your VM



   a. on your VM this is how you proceed to the installation
[root@RHEL5-Serv01 ~]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@RHEL5-Serv01 ~]# ls /mnt/cdrom/
32Bit        autorun.sh                VBoxWindowsAdditions-amd64.exe
64Bit        VBoxLinuxAdditions.run    VBoxWindowsAdditions.exe
AUTORUN.INF  VBoxSolarisAdditions.pkg  VBoxWindowsAdditions-x86.exe
[root@RHEL5-Serv01 ~]# /mnt/cdrom/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.0.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.0.4 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules            [  OK  ]
Removing existing VirtualBox non-DKMS kernel modules      [  OK  ]
Building the VirtualBox Guest Additions kernel modules
Your guest system does not seem to have sufficient OpenGL support to enable
accelerated 3D effects (this requires Linux 2.6.27 or later in the guest
system).  This Guest Additions feature will be disabled.


Building the main Guest Additions module                   [  OK  ]
Building the shared folder support module                  [  OK  ]
Doing non-kernel setup of the Guest Additions              [  OK  ]
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Installing X.Org 7.1 modules                               [  OK  ]
Setting up the Window System to use the Guest Additions    [  OK  ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[  OK  ]

   b. from  VirtualBox Device menu click on "shared folder" and choose your windows shared folder






   c. lets first see what is on your WINDOWSSHAREFOLDER before mounting to the redhat VM

   d. Now mount your windows shared folder to your redhat VM and view the folder

 [root@RHEL5-Serv01 ~]# mount -t vboxsf WINDOWSSHAREFOLDER /home/doumbia/Desktop/VMSHAREFOLDER
[root@RHEL5-Serv01 ~]# ls /home/doumbia/Desktop/VMSHAREFOLDER/
IMG_0148.JPG
[root@RHEL5-Serv01 ~]#

   e. You can also send files from your redhat VM to Windows just by dragging them into to the VM sharefolder


     NOTE: to write from linux VM you have to be out of the shared directory ,
              create a file and move it to the sare directory or it won't work.

 f. Now lets see the files you sent from your redhat VM to windows
  

done

No comments:

Post a Comment