VirtualBox shared folder settings and automatic mount details tutorial _virtualbox

Source: Internet
Author: User
Tags virtualbox shared folder

Since Alipay and other services ignore the existence of our Linux users, there is no way to use the VirtualBox virtual a Windows system on Linux. System installed, in the day-to-day use of the process, often from the VirtualBox client (guest system) in the host system in the file, then the way to share the folder to achieve this goal.

I am here to write a graphics and text tutorial, explaining the setup process, I hope to help you. (Note: My host is Ubuntu Linux 8.04, the client is a Windows Xp,virtualbox version 2.2.4 "Download")

After installing Windows XP in VirtualBox, first install the kit Vboxguestadditions.iso, which is located under the VirtualBox installation directory, and mine is under the/usr/share/virtualbox directory. Click "Settings" in the VirtualBox Control Panel and select "Optical drive" to load the image. After you start the virtual machine into XP, install the Accessibility kit.

The next step is to set up a shared directory. In VirtualBox first select your virtual system, then "set", select "Data Space", click the Plus button, the following figure:
The window that adds the data space appears, in the "Data Space position" Drop-down box, click "Other", select the folder you want to share, "Data space name" fill in your name, here I fill in the TMP, read-only options according to their own circumstances, configuration, the following figure:
Then start to enter the client Windows XP, open "My Computer", click on the menu bar "Tools"-"Map Network Drive", Drive letter, folder Fill "\\vboxsvr\tmp", TMP is the "Data space name" I set before, change TMP to you just set the " Data space name "can be, as shown in the following figure:
When you are sure, you can see the disk label for the shared folder in the network drive, as shown in the following figure:
OK, now double-click the icon in the network drive to read and modify the files in the Linux host.

The problems encountered:

Use the application to open the file directly in the XP shared folder, and you cannot save it directly after you modify it, such as using Photoshop to open a picture and modify it, Ctrl+s cannot save, prompting the file to be locked.

Solution:
Copy the files from the shared folder to your local disk on Windows XP, and then copy back to the shared folder after the modification is complete.

Another article: How to use the VirtualBox shared folder

(Windows XP SP2 as guest for host,red Hat 9.0)

After VirtualBox the REDHAT9 virtual machine in Windows, Box wants the two systems to swap files. There are several ways to swap files, the simplest of which is to use shared folders.

First, run VirtualBox on Windows. As shown in the figure, select Red Hat 9.0, and then choose Shared Folders.
Clicking on "Shared Folders" will pop up the Red Hat 9.0 Settings dialog box. You can add a new shared folder at this time. Box has a directory called sharing on E disk, and it's used. Note that the folder name "sharing" in the figure is also known as the share name (sharename). It is used when the Redhat9 is mounted on a shared folder.

When you are sure, you can see that the number of shared folders has changed to 1.

The host is ready, guest Redhat9 to enjoy "Shared Folders" you first have to install the Accessibility kit. This helper kit is an image file called Vboxguestadditions.iso, located under the VirtualBox installation directory. Click "Optical Drive" to load the image.

Start the virtual machine and install the Accessibility kit. Because the box installed virtual machine does not have a graphical interface, the kit is installed with vfs-module parameters.

    • Mount/dev/cdrom Mounted Optical Drive
    • Cd/mnt/cdrom into the disc
    • Sh./vboxlinuxadditions.run Vfs-module not fully installed here
    • Reboot reboot system after successful installation

After the reboot, REDHAT9 can access the shared folders that Windows provides.

    • Mkdir/mnt/share New mount point (mountpoint)-Note: This mount point can also be placed under the/home/*** directory
    • Mount-t vboxsf sharing/mnt/share Mount shared folders
    • Cd/mnt/share into the shared folder
    • LS See what's

OK, that's it.

Attention:

1. If you want to delete the mount, execute the command

Umount-f/mnt/share

2. If you want to boot automatically mount, you can add an item at the end of the/etc/fstab file

 Sharing/mnt/share vboxsf Defaults 0 0

Or

Sharing/mnt/share vboxsf Rw,gid=100,uid=1000,auto 0 0

3. For convenience, you can create a new file on your desktop that reads:

#!/bin/sh 
sudo mount-t vboxsf sharing/mnt/share

Practical experience:

The above information is extracted from the internet, for the "Power-on Automatic mount" module, I tried many times to fail, most of the network data is said in the/etc/fstab file appended VirtualBox virtual machine folder share Mount command "Sharing/mnt/share vboxsf Defaults 0 0 ", in fact, is wrong, because when the system calls Fstab, the VirtualBox shared directory module has not been loaded, so each load will fail, the final solution is as follows:

Append the following command to the file/etc/rc.local (with root)

Mount-t vboxsf Sharing/mnt/share

Finally reboot the system,!!!.

In addition, in the VirtualBox 4.x version, there is already an "automatic mount" feature, as shown in the following illustration:

Then use the command mount to get the following mount information:

[Jianbao@localhost ~]$ Mount
/dev/sda1 on/type ext3 (rw)
proc on/proc type proc (rw)
SYSFS on/sys type sys FS (rw)
devpts on/dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on/dev/shm type Tmpfs (rw,rootcontext= "System_u" : Object_r:tmpfs_t:s0 ")
/dev/sda2 on/home type ext3 (rw)
sharing on/mnt/share type vboxsf (UID=1000,GID=100,RW)
None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)
sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) C10/>htdocs on/media/sf_htdocs type vboxsf (GID=501,RW)
sharing on/media/sf_sharing type vboxsf (GID=501,RW)

It automatically mounts these shared folders to/media/, the directory below, and I want to say that this mount directory is not what I want,

So I did not use VirtualBox automatic mount function (because the mount directory itself is not controllable).

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.