Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to interact files with a virtual machine

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to exchange files with the virtual machine. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The method of transferring files using a virtual machine:

Use the FTP protocol

Use the disk tool

Use SMB protocol (key)

Use the FTP protocol

FTP is the English abbreviation of File Transfer Protocol (File transfer Protocol), while the Chinese abbreviation is "text transfer Protocol". Used for two-way transfer of control files on Internet. It is also an application (Application). There are different FTP applications based on different operating systems, and all of these applications follow the same protocol to transfer files. In the use of FTP, users often encounter two concepts: "Download" and "Upload". To "download" a file is to copy a file from a remote host to your own computer, and to "upload" a file is to copy a file from your own computer to a remote host. In the Internet language, users can upload (download) files to (from) a remote host through a client program.

To use the FTP protocol, you need to install the FTP client. Like Xftp,FileZilla.

You can also use the FTP function of Xshell, MobaXterm and other software.

The Linux operating system is generally installed from the image, and the ftp service is configured. If not, you can configure it using the following methods:

Install the vsftpd server

Sudo apt-get install vsftpd

Configure the vsftpd.conf file

Sudo vi / etc/vsftpd.conf

The contents that need to be modified are as follows:

Anonymous_enable = NO # does not allow users to log in anonymously

Local_root = / home/username/ftp # set top ftp upload and download directory

Local_enable = YES # allow local login

Chroot_list_enable = YES chroot_list_file = / etc/vsftpd.chroot_list # allow users in vsftpd.chroot_list to log on to the server

Write_enable = YES # allows you to upload files to the server

Sudo vim / etc/vsftpd.chroot_list # create files to add users

Subtract the w permission from / home/username/ftp, that is, the owner of the folder cannot have write omni-directional

Create a share folder in / home/username/ftp

Sudo / etc/init.d/vsfftpd restart # restart the service to make the configuration effective

PS:SFTP protocol

FTP is a file transfer protocol, generally designed to facilitate data sharing. Includes a FTP server and multiple FTP clients. FTP clients download resources on the server through the FTP protocol. The SFTP protocol encrypts the data on the basis of FTP, which makes the transmitted data more secure. But this kind of security comes at the expense of efficiency, that is, the transmission efficiency of SFTP is lower than that of FTP (although there is not much difference in practical use).

Use the disk tool

For example: DiskGenius,Ext2IFS and other tools.

Using DiskGenius needs to be used when the virtual machine is turned off. The method of use is:

Open the software

Hard disk-- > Open virtual hard disk files such as: G:\ VMwareSys\ U16\ Ubuntu16.04.vmdk

After opening it, you can copy the file in and out.

There is a problem opening the Linux system virtual hard disk on Win10. You may need to configure bios.

There is no problem opening the virtual hard drive of the windows system on win10.

SMB protocol

SMB (Server Message Block) communication protocol is a protocol formulated by Microsoft and Intel in 1987, which is mainly used as the communication protocol of Microsoft network. SMB is a protocol at the session layer (session layer) and presentation layer (presentation layer) and a small portion of the application layer (application layer).

SMB uses NetBIOS's application program interface (Application Program Interface, referred to as API). In addition, it is an open protocol that allows protocol extensions-making it larger and more complex; there are about 65 top-level jobs, each with more than 120 functions, and even Windows NT does not support all of them. Microsoft recently renamed SMB to CIFS (Common Internet File System) and added many new features.

First, you need to install the samba software on the virtual machine.

Samba is a free software that implements SMB protocol on Linux and UNIX systems, which is composed of server and client programs. SMB (Server Messages Block, Information Service Block) is a communication protocol for sharing files and printers on the LAN. It provides sharing services for files, printers and other resources between different computers in the LAN. SMB protocol is a client / server protocol, through which clients can access shared file systems, printers, and other resources on the server. By setting "NetBIOS over TCP/IP", Samba can share resources not only with LAN hosts, but also with computers around the world.

PS: the demo environment is DeepinLinux!

Sudo apt-get install smaba smaba-common

Create a directory for interaction, such as me: / home/lzc/share

Change the permissions of the directory to 777

Sudo chmod 777 / home/lzc/share

Then modify the configuration file for samba:

Sudo vim / etc/samab/smb.conf

Add the following lines at the end:

[share]

Path = / home/lzc/share # Please use absolute path

Available = yes

Browsable = yes

# public = yes # No password required

Writable = yes

Create an account for smaba:

Sudo touch / etc/samba/smbpasswd

Sudo smbpasswd-a username

Restart samba to make the configuration take effect:

Sudo / etc/init.d/smbd restart

How to access it under win?

Open the explorer, enter the "\" + IP address of the virtual machine in the address bar, and enter the account password. If you don't want to bother, open the public in the following content.

[share]

Path = / home/lzc/share # Please use absolute path

Available = yes

Browsable = yes

Public = yes # No password required

Writable = yes

At this point, open the explorer, and then on the network, you can see that there is an extra virtual machine.

This is the end of the article on "how to interact with virtual machines". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report