Platform migration-7 (two methods for sharing files between Linux and Windows hosts in virtual-PC)

Source: Internet
Author: User

Preface:

Virtualpc is often used for porting and development, but it is a little troublesome to share files with the host. This article introduces two practical methods: FTP and mount command mounting.

(Note: The Linux host is the same as the Windows host)

1. Enable FTP in Windows-IIS to share files

A. Install IIS first (select FTP)
B. Set the FTP Master Directory and access permission in FTP properties in IIS.
C. After setting, run iisreset (restart IIS) in Windows-cmd)

In virtualpc, you can access FTP through FTP: // xxx.

2. Type A command in Linux-shell to share files.
In Shell, Enter command:
Mount-T smbfs-O username = xxx, password = xxx // xxx/Alibaba Folder/usr/share/XXX/Alibaba folder

The above is similar to creating a corresponding directory to map the shared directory under windows.
Note:
Windows shared directory: // xxx/movie folder
Linux ing Directory:/usr/share/XXX/folder

In virtualpc, you can directly access the ing directory.

Note: The file is shared in the Mount mode and is invalid after the machine reboot. Therefore, you can enter the command in/etc/profile (that is, the command runs immediately upon startup)
For more information about the Mount/umount command/application, see:

 

Mount (interpret the content of a file as a file system, and then attach it to a location in the directory)

Enable sharing:
Mount-T smbfs-O username = xxx, password = xxx // xxx/Alibaba Folder/usr/share/XXX/Alibaba folder

Note-1: Mount is only available for root users.
Note-2: The Mount effect disappears after the machine reboot

Therefore, if it is usercount and you want to use mount, perform the following operations:
1). Set the Mount permission relative to usercount:
Run cmddo in cmd to open the sudoers file.
Find the line "root all = (all) All" and add it below:
Usercount all = nopasswd:/bin/Mount
Note: input I to insert, Press ESC and enter: WQ to save and exit, Press ESC and enter: X to save and exit
2) set the above mount command to start upon startup
Compile the/etc/profile file
Add command at the end:
Sudo Mount-T smbfs-O username = xxx, password = xxx // xxx/login Folder/usr/share/XXX/login folder

Umount (detachable file systems currently in the Linux directory)

Unload sharing:

Umount // xxx/login folder

 

Summary:

In practical applications, I prefer to use the mount command, because you can use the convenient IDE in Windows to improve code writing efficiency, and then switch to virtualpc to use makefile for compilation, very nice ^_^.

(If FTP is used, it is very troublesome to transmit the file ~ _~)

 

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.