Experience in configuring Samba servers between virtual machines and physical machines

Source: Internet
Author: User

Due to my habits, I have to recreate the Samba server many times. It takes some time to get through every time. To sum up.

Step 1: ping the Virtual Machine and your physical host. The Network Mode I selected is briged. First configure your eth0, the above IP address, subnet mask, and gateway. Ping the IP address directly after setting the IP address. Click vmware-> edit-> virtual network settings, click the automatic briging tab, which also has the automatic bringing option. After selecting, click Add below, add your Nic, and click Apply. Then switch to host virtual network mapping and select the corresponding Nic In vmnet0. Then confirm the application so that the Ping is successful.

Step 2: Install the Samba server and client. First use service SMB restart to test whether there is a samba service. If yes, you do not need to perform this step. If you are prompted that this service is not available, go to your installation CD and find out the installation packages. Mount/dev/CDROM/mnt my installation packages are all in the packages folder. Run rpm-Qa | grep Samba to check the Samba package you have installed. After that, you can install the package that has not been installed. After the installation, the Service SMB restart can start the SMB server. The nmb server may not be started after this command is run due to version issues.
Nmb start command to start the nmb server.

Step 3: Disable the firewall. If this step is not done, the shared directory in Linux may not be displayed.

Step 4: Configure/etc/samba/smb. conf. Back up data before configuration. Go to global settings

[Global]
Workgroup = linuxsir
NetBIOS name = linuxsir05
Server String = Linux Samba server testserver
Security = Share

Standalone server options

Comment out security = user and passdb backend = tdbsam with a semicolon

 

[Linuxsir]
Path =/opt/linuxsir
Writeable = Yes
Browseable = Yes
Guest OK = Yes

Enter the following command on the command end:

Mkdir-P/opt/linuxsir

Id nobody (the following command authorizes the nobody user)

Chown-r nobody: Nobody/opt/linuxsir

 

Step 5: In the config file of/etc/selinx/, change selinx = enforcing to selinx = disabled. (If you do not have this step, you may not be able to create a file in the shared directory)

Step 6: reboot, and then start SMB, nmb server.

 

Possible problems (Environment: vmware6 + RedHat Enterprise 6)

1. Ping failure between physical machines and virtual machines

If your virtual Linux host is a GNOME desktop, there will be a network connection icon in the upper right corner of the desktop to see if there is an "X" number. If yes, it indicates that the network is not connected, generally, after you click system eth0, The 'X' is removed.

It may also be the IP address of the network. The subnet mask and Gateway may be incorrect.

2. The Gateway cannot be pinged.

It doesn't matter. You can still implement the samba service between the virtual host and the physical host.

3. The physical machine cannot ping the virtual machine. The virtual machine can ping the host, or vice versa.

These may be related to the firewall.

Tip: the original intention of setting up Samba is to share files between the physical host and the virtual host. If there are other file sharing methods, you do not need to set up Samba.

I recently discovered that, in the environment: vmware6 + Virtual Machine RedHat Enterprise 6 + Physical host Windows XP, the virtual machine files and Windows files and text can be copied to each other, it seems to be the same in the same system. So I will not use this samba for development in the future.

 

 

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.