Configuration of VirtualBox data space in Linux

Source: Internet
Author: User
Tags oracle vm virtualbox vm virtualbox

This section describes how to mount the host folder in Linux in VirtualBox to share files between virtual machines and hosts.

Environment: Oracle VM Virtualbox 4.0.10 + CentOS 6.0

1. Install VirtualBox Guest Addition in CentOS

On the current virtual machine interface, click "device"-"Assign Optical Drive"-"Choose a virtual CS/DVD ..."

Open the installation folder of VirtualBox, which defaults to "C: \ Program Files \ Oracle \ VirtualBox", and select "VBoxGuestAdditions. iso" for mounting.

Open the CentOS Super Terminal and run the following command to install VirtualBox Guest Addition.

[Root @ Slyar ~] # Mount/dev/cdrom/mnt
Mount: block device/dev/sr0 is write-protected, mounting read-only
[Root @ Slyar ~] #/Mnt/VBoxLinuxAdditions. run

The first is to mount the disc to/mnt, and the second is to install the disc. Wait until the installation is complete. (If you do not have X desktops like me, the last one may be Failed without any impact)

2. Configure the Data Space

On the current virtual machine interface, click "device"-"allocate data space". In the pop-up interface, add a temporary allocation (fixed allocation is also acceptable, not called)

"Data space location" is your shared folder. Remember the data space name. Do not select "Read-Only allocation" or "Auto-mount ".

3. Restart the Operating System

[Root @ Slyar ~] # Reboot

4. Mount the shared data space

After starting the system, you can use the following command to mount the data space (assuming the data space name is slyar) to/mnt, where "-w" is writable. to read-only, you can change it to "-r"

[Root @ Slyar ~] # Mount. vboxsf-w slyar/mnt

5. unexpected circumstances

If the disk cannot be mounted due to an accident, you can directly access the following directory to use the shared space.

[Root @ Slyar ~] # Cd/media
[Root @ Slyar media] # ls-l
Total usage 0
Drwxrwx --- 1 root vboxsf 0 July 15 15:13 sf_SLYAR

"Sf_SLYAR" is the shared data space folder.

PS. You can try to re-mount the vboxsf module:

[Root @ Slyar ~] # Modprobe vboxvsf

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.