VMS in Linux with Windows shared folder ZT
Describes the host is Windows, the client is the setting under Linux.
1, installing Vmtools for Linux
Select the VMware Workstation Program menu Vm>install VMware Tools ...
To start Linux on the guest computer, execute:
Mkdir/mnt/cdrom
Mount/dev/cdrom/mnt/cdrom
Cd/mnt/cdrom
TAR-XZVF VMWARETOOLS-5.0.0-12124.I386.TAR.GZ-C/tmp (unzip the installation file to/tmp)
Cd/tmp/vmware-tools-distrib
./vmware-install.pl
Here, the installer asks a series of setup questions, and in most cases, the installation works as expected by default configuration. Therefore, it is recommended that you press ENTER to select the default configuration for each issue, or enter the default prompt path and press ENTER to OK. After running, you can enter the/MNT directory, you should be able to see a number of folders Hgfs.
2. Set the host computer shared directory
Switch to the Windows desktop in Ghost Computer, select the VMware Workstation Program menu
Vm>settings>options>shared folders>properties
Click on the "Add" button at the bottom right of the dialog and click "Next" to enter the name of the shared directory in the text box "name" (for example, if you want to share the D-drive, you can enter a shared name, whatever name is just a symbol.) You can then select a corresponding drive letter or file. This disk or folder is a file shared by winds and Linux. It will be visible in both systems. )
Use of the 3,shared folder directory
Switch to Ghost computer's Linux system and execute:
Cd/mnt/hgfs
Ls
You can see that there are winds folders or drive characters under your share. And can be used directly. Read and write operations are available under both winds and Linux. At the same time you will also find that you have to use Ctrl+alt to switch the mouse, in the installation of the tool good, the mouse can be free to switch.
Start by setting up a mount directory.
sudo mkdir/mnt/share
The shared directory is then loaded in.
Server: 192.168.6.84
Share name: GG
User name: Administrator
Password: 123
The command is as follows:
sudo mount//192.168.6.84/gg/mnt/share/-oiocharset=utf8,username=administrator,password=123,dmask=777,fmask=777, Codepage=cp936,uid=0
Plus Iocharset=uf8 and codepage=cp936. After this is mounted well, it can be used, can solve the problem of garbled characters in Chinese file names.
Another said:
Assume that your network connection is set up correctly.
ip:192.168.0.1 of Network hosts
User name of network host: MyUserName
Login password for network host: MyPassword
Directory name in the share: Linux
Directories to mount on the host:/media/sharename
When you want to mount a network share directory
sudo mkdir/media/sharename
sudo mount//192.168.0.1/linux/media/sharename/-ousername=myusername,password=mypassword,dmask=777,fmask=777
When you want to uninstall a network share directory
sudo umount/media/sharename/
Systematic Learning Instructions:
Implement Linux and Windows mutual visits summary
SMB is a bridge between Linux and Windows, so let's take a look at what is SMB, its main function, the way and configuration of sharing through SMB. In the end we also described how to use the Mount command to mount a Windows shared directory.
A About Samba
Samba (SMB is its abbreviation) is a Web server for Linux and Windows shared files, and samba can be used for shared files between Windows and Linux, as well as for shared files between Linux and Linux. But there is a better network file system for sharing files between Linux and Linux Nfs,nfs also need to set up a server;
You know that every machine in the Windows network can be a file-sharing server or a client, and samba can do the same, like a Linux machine, which, if it's a samba server, can act as a shared server. It can also be a client to access Windows shared file systems in other networks, or other Linux Sabmba servers;
We see in the Windows network that the shared Files feature knows that we can directly use the shared folder as a local hard drive. In Linux, it is through samba to the network of the machine to provide a shared file system, but also the network of other machines can be shared on the local computer to use, in a sense, and FTP is not the same.
Two Samba server startup and server configuration files
Samba has two servers, one is SMB and the other is NMB;
SMB is the primary boot server for Samba, allowing other machines to know what the machine shares;
The NMB is parsed, which resolves the workgroup shared by this Linux machine and the netbiosname in this workgroup. If you do not open the NMB server, you can only access via IP, that is, in Windows Internet Explorer to enter the IP of the Linux computer to access, for example: \192.168.0.1est, and the computer name of the input Linux can not be accessed, such as: \ Wangyh est.
Therefore, you must start the SMB service after you install the Samba server. Here are the commands to start, view, and close the SMB server
1. In general, in the RPM package of the system, if it is installed with RPM package Samba, generally can be used in the following way to start the Samba server;
[[email protected] ~]#/ETC/INIT.D/SMB start
2. For all Linux systems, the common approach is to run SMB and NMB directly, and enter the terminal to tap the directory where samba resides in the command line under root, but you need to know the directory where SMB and NMB are located; If you compile your own samba, the directory you should know;
For example: Samba is located in a directory of/USR/SBIN/SMBD (NMBD), which starts SMB input as follows:
[Root WANGYH:/HOME/WANGYH]#/USR/SBIN/SMBD
[Root WANGYH:/HOME/WANGYH]#/USR/SBIN/NMBD
3. When you're done, check to see if the Samba server is running, and look at the following commands:
[Root Wangyh:/home/wangyh]#/pgrep smbd
[Root Wangyh:/home/wangyh]#/pgrep nmbd
4. Close the SMB server with the following command:
[Root Wangyh:/home/wangyh]#/pkill smbd
[Root Wangyh:/home/wangyh]#/pkill nmbd
SMB configuration files and tools for server-side and clients
1. If we are using the Linux distribution to bring the samba package, in general, the Samba server configuration files are located in the/etc/samba directory, the server's main configuration file is smb.conf, there are user profiles smbpasswd, Smbusers and Lmhosts and so on; a file is Secrets.tdb, which is generated automatically when the Samba server is started;
2. Several of the main common server-side tools in the SMB server are SMBD, NMBD, SMBPASSWD, and the client is Smbmount (there is no Ubuntul in the Smbmount 6.06 kernel, so it does not support this command, But can use mount plus parameter of the situation to achieve mount), smbclient and so on.
Implement Ubuntu Linux 6.06 and Windows system visits
1. Windows 2000/xp/2003 access Ubuntu Linux system (tested)
First step: Install Samba,smbclient,smbfs
Command: [root wangyh:/home/wangyh]# apt-get Install Samba
[Root wangyh:/home/wangyh]# apt-get Install smbclient
[Root wangyh:/home/wangyh]# apt-get Install Smbfs
Step Two: Change the smb.conf file
It's a good idea to back up the smb.conf file before you change it for beginners.
Modify the smb.conf file with either the VI or GEDIT commands, as follows:
[Root wangyh:/home/wangyh]# vi/etc/samba/smb.conf
[Root wangyh:/home/wangyh]# gedit/etc/samba/smb.conf
The changes in [global] are as follows:
Add two lines below [global]
Doc Charset=utf-8
Unix Charset=utf-8
Workgroup=workgroup
Add a line below NetBIOS Name=wangyh (the computer name for this machine)
Find passwd program will change it to
passwd program=/etc/samba/smbpasswd
Locate the security line and change it to
Security=user
Find the [Homes] section to modify the following
Browseable=yes
Writable=yes
If we want to create a shared folder in a file, we just need to write the segment later
[Wangyh] (Shared files)
Path=/home/wangyh (shared folder path)
Browseable=yes
Public=yes (displayed in the Network Neighborhood)
Writable=yes
Of course, in the Ubuntulinux system, click System---system management, shared folder, select the shared folder here is also available, after setting up, the system automatically writes the shared information you set to the smb.conf file.
Annotations:
Workgroup is the workgroup that is displayed in Windows;
NetBIOS name is the name of the computer displayed in Windows;
Security This is the authentication and login method, here we use the user, there are many kinds of authentication methods, this is one of the most commonly used, is the share authentication method, this way is not set up user and password, but this way is very low security level, generally we do not use this way And another is that the Server,server mode requires the user's authentication to be done by a Samba server or an NT Server.
Browseable can be browsed, browseable=yes, for browsing, we can see the shared folder under the workgroup. If you browseable=no, the folder will not appear in your workgroup.
Writeable is writable, here I set as writable;
Step three: Add the SMB user and set the Linux user password
It is important to note that before adding an SMB user, it must be added as an Ubuntu Linux user, with the following command:
1) Add as Linux User
Adduser–a heqing (heqing for user name)
Enter new UNIX password:*****
Retype new UNIX password:*****
The rest of the items can be entered as prompted
2) Add the SMB user and set the SMB password
Smbpasswd-a heqing (existing Linux users)
NEW SMB passwd:******
Retype NEW SMB passwd:******
Add success
The last thing to note is that the Linux user password for the heqing user can be different from the SMB password
Fourth step: Setting up the Windows client
After basically completing the above configuration windows will be able to access the Ubuntu Linux system in the shared folder, if Windows in the Network Neighborhood or through IE can not see, to see two points
On the Windows Terminal ping Ubuntu Linux system host IP, if you can ping the pass, look at the next bar.
1) Check to see if the Windows Firewall prohibits other computers from accessing the computer or whether to allow ping in. If you can, look at the next one.
Check that the guest user in the Windows user settings is disabled, and if disabled, release it.
Through the above settings in the Windows computer Network Places or IE can see the ubuntulinux system of shared files, and can modify it, paste new files, copy the original files and so on.
2. Ubuntu Linux system access to Windows xp/2003/2000 system
In my testing process, there are 3 ways to implement the Ubuntu Linux system to access the Windows system, and I will illustrate these several ways as follows:
The first type: Access with SMB
If the IP address of the Ubuntulinux system Terminal Pingwindows host can be ping, and the Windows computer has a shared folder, open the network server under the location, click Windows Network->workgroup in the interface, You can see the Windows computer name in the workgroup group, double-click the dialog box that pops up the user name and password, and you can access it by setting up the user name and password for SMB.
The second type: access to the server function with the Ubuntu system's own connection
Start connecting to the server in the location, select Windows Share in the service type, enter the IP address or computer name of the Windows computer in the server, click Connect so that a file volume is displayed on the system desktop that is connected to the Windows computer.
We can access it like a disk in the Ubuntu system, as well as enter the SMB username and password when accessing it.
Third: Mounting windows ' shared directory to local disk with Mount '
The first thing to do is to set up a mount point in the Ubuntu system, where we set up a hang point for/mnt/wind
Also to ensure that the network connection is normal, and Windows has a shared directory under the premise of doing a bit of action
With Windows IP 192.168.0.1, shared folder for share as an example
The command is as follows:
Mount-t Smbfs–o Username=wangyh,password=123456//192.168.0.1/share/mnt/wind
There is such a problem when the access will be garbled in Chinese, so we can follow the command to execute, can solve the problem
Mount-o SMBFS-OIOCHARSET=UFT8,CODEPAGE=CP936,CLMASK=777,FMASK=777,USERNEME=WANGYH,PASSWORD=123456//192.168.0.1/ Share/mnt/wind
Note: Both Usename and password are SMB users and passwords, and if you want to learn more about the Mount command, use Manmount to view detailed usage in the terminal
Fourth: Use the smbclient command
The command is as follows:
Smbclient–l//192.168.0.1/share-u Wangyh
Password: Enter the password for the SMB user Wangyh
You can use the Enter to download the file with the command get, upload the file with put.
Annotations:
Smbclient Introduction:
Command description
? or Help [command] for help or a command
! [Shell command] executes the shell commands used, or lets the user enter the shell prompt
CD [directory] switches to the specified directory on the server side, if not specified, Smbclient returns the current local directory
LCD [directory] switch to the client-specified directory;
Dir or LS lists the files in the current directory;
Exit or quit Quit Smbclient
Get file1 file2 download file1 from the server and file2 on the local machine with the file name;
If you don't want to change your name, you can omit file2
Mget file1 file2 file3 filen download multiple files from the server;
MD or mkdir directory created on the server
Rd or RmDir directory deletes a directory on the server
Put File1 [file2] to the server to upload a file file1, to the server renamed to File2;
Mput file1 file2 Filen uploading multiple files to the server
A About Samba
Samba (SMB is its abbreviation) is a Web server for Linux and Windows shared files, and samba can be used for shared files between Windows and Linux, as well as for shared files between Linux and Linux. But there is a better network file system for sharing files between Linux and Linux Nfs,nfs also need to set up a server;
You know that every machine in the Windows network can be a file-sharing server or a client, and samba can do the same, like a Linux machine, which, if it's a samba server, can act as a shared server. It can also be a client to access Windows shared file systems in other networks, or other Linux Sabmba servers;
We see in the Windows network that the shared Files feature knows that we can directly use the shared folder as a local hard drive. In Linux, it is through samba to the network of the machine to provide a shared file system, but also the network of other machines can be shared on the local computer to use, in a sense, and FTP is not the same.
Two. Several sets of samba, installation and simple configuration
Samba,samba-client, Samba-common
A sudo apt-get install samba samba-client can be loaded on all
Starting samba is also simple: Sudo/etc/init.d/samba start
To set the Samba password, you can add the Samba user first, which must be the system user.
Smbpasswd-a yourname
Three. Visits
1) Windows access Ubuntu
Windows access to Ubuntu is very simple, first set up a shared directory on Ubuntu, right-click Directory, select Sharing options, enough to choose Share this folder, if necessary, you can also select the following allow write
You can find the shared directory on the network in the Network Neighborhood of Windows, and through//host
2) Ubuntu access to Windows
The first: Browse directly from the Ubuntu network
Location---Network, click on the interface of the Windows network->workgroup, in the workgroup group can see the Windows computer name, double-click will pop up the user name and password to enter the dialog box, You can access the user name and password that we set up for SMB above.
The second type: access to the server function with the Ubuntu system's own connection
Location, connect to the server, select Windows share in the service type, enter the IP address or computer name of the Windows computer in the server, click Connect, and a file volume connected to the Windows computer will be displayed in the system desktop. Inside is the shared directory of the Windows computer.
Also enter the user name and password for SMB when accessing.
Third: Mounting windows ' shared directory to local disk with Mount '
The first thing to do is to set up a mount point in the Ubuntu system, where we set up a hang point for/mnt/wind
Also to ensure that the network connection is normal, and Windows has a shared directory under the premise of doing a bit of action
With Windows IP 192.168.0.1, shared folder for share as an example
The command is as follows:
Mount-t Smbfs–o Username=wangyh,password=123456//192.168.0.1/share/mnt/wind
There is such a problem when the access will be garbled in Chinese, so we can follow the command to execute, can solve the problem
Mount-o SMBFS-OIOCHARSET=UFT8,CODEPAGE=CP936,CLMASK=777,FMASK=777,USERNEME=WANGYH,PASSWORD=123456//192.168.0.1/ Share/mnt/wind
Note: Both Usename and password are SMB users and passwords, and if you want to learn more about the Mount command, use Manmount to view detailed usage in the terminal
Fourth: Use the smbclient command
In general, all shared directories are listed first, with the following command:
Smbclient–l//192.168.0.1/-U yourname
After you enter the password for SMB, you will see a list of shared directories.
If you enter the shared directory share, the command is as follows:
Smbclient//192.168.0.1/share-uyourname
You will then see a smb:>
has entered the SMB mode, some like FTP, knocking help can see the relevant commands, get,put can download and upload files.
Five. Summary
The above steps, for the simple use of Ubuntu and Windows file sharing in the exchange of visits is sufficient, more detailed information can be consulted: http://linux.vbird.org/linux_server/0370samba.php#server_pkg
Linux and Windows shared folders in embedded VMS