Linux Mint (host and virtual machine-virtualbox share files) __linux

Source: Internet
Author: User
Tags linux mint

We have described in the previous blog How to install the virtual machine: Virtualbox. It is convenient to use after installation, especially in file sharing. Next I'll share with you how to share files between a host and a virtual machine.

There are two ways to share files between a host and a virtual machine: share a clipboard. Shared folders.

When you share a clipboard, the contents of the Clipboard are limited to commands, or strings, and files cannot be shared by the Clipboard. Shared folders can make up for the lack of a shared clipboard, which we can use to share files between hosts and virtual machines. Next we'll introduce the two ways of sharing files separately. Shared Clipboard

specific steps: Set the -> General-> Advanced.
Under the Advanced tab there is a "shared pasteboard" option, click on the inverted triangle to the right of it, and then choose Bidirectional. Here is the screenshot of the operation, please refer to:

After the selection, click OK, so that you save the changes just now. From then on, we can copy content between the host and the virtual machine through the Clipboard. For example, we run a command on the host's Terminal: Gcc-g test.c test. We can copy the command and paste it in the terminal of the virtual machine. The command you just copied appears in the terminal of the virtual machine. We do not need to manually enter the same command, is not very convenient. Shared Folders

specific steps: set up-> shared folder-> this time to enter the shared Folder Settings window.
Click on the "+" icon on the right side of the window, and a small window will pop up to select the path to the shared folder and the name of the shared folder. Once you have selected the folder path and name, you can click OK to save the changes you just made. However, before clicking OK, it is best to select the "Automatically mount" check box in the window. This will be able to automatically mount the shared folder at the time of Power-on, Mount point for/media/sf_sharedir/. The shared folder path I set is/home/virtualboxvms/sharedir, where Sharedir is the name of the shared folder. The detailed screenshot of the operation is as follows:

Next we give an example to illustrate how to share files through shared folders: 1. Put the files that you need to share in the host into the shared folder.

Command: Cp-a test.c/home/virtualboxvms/sharedir
2. Remove the shared files from the shared folder in the virtual machine.
Command: Cp-a/media/sf_sharedir/test.c  /home/code/(requires root permission to execute this command)

About the host and virtual machine (Virtualbox) share the contents of the file is introduced here, there are other use of skills, and then share with you.

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.