Configuring the Samba Sharing method in virtual box

Source: Internet
Author: User

Because later work to use Linux, so first study ahead. We usually use the Linux environment is generally based on the virtual machine platform for programming and writing shell, and some documents or materials have to be queried and written under Windows, such operations are cumbersome and not conducive to the study of Linux.

Virtual box is a virtualized machine developed by Oracle company that is easier to use and smaller than VMware. First of all, the virtual box network configuration method, there are generally four kinds:

1:nat Network address translation (network addressing translation), should be a virtual confidential packet to the host, and then sent by the host's network card.
2:birdged Network Bridge, this way, is the virtual machine and host equal flat, two equivalent to stand-alone machines, outside the intranet can also access my virtual machine, in the Ubuntu version of Linux, here only need to select DHCP automatic access to it.
3:internal Network Internal network (can be between virtual machines and virtual machines)
4:host-only only communicates with host (approx.)


After installing VirtualBox, the host has a "VirtualBox host-only network" local network card.

Here to pay attention to the more this local network card connection to configure, because virtual box DHCP server IP address is 192.168.56.100, so VirtualBox host-only The IP address of the network network card should be set to 192.168.56.1, making the network card and server in the same network segment.

Then use the command line in Linux to view the IP address of the ETH0 network, and use the cmd ping command in Windows to check whether the virtual machine is connected to the host.


Once connected, you can configure the Samba server in Linux.

1 Installing Samba Services

The Ubuntu version can be installed through the Software Center direct graphical interface, this method is easiest.

Alternatively, you can use the command line:

sudo apt-get install Samba

sudo apt-get install Smbfs

2 Creating a shared directory

Mkdir/home/xiaoming/share

sudo chmod 777/home/xiaoming/share

3 New User

Usradd Samba

SMBPASSWD (set Samba access password, note not user login password)

4 Configuring Samba

1 Backup existing configuration file

sudo mv/etc/samba/smb.conf/etc/samba/smb.conf.bak

2 Create a new samba configuration file

Sodu vim/etc/samba/smb.conf

smb.conf*******************************************

[Global]

; Create a workgroup

Workgroup = MyGroup

; Safe Mode, we set the minimum security level

Security = Share

; Whether to allow guest users to access

Guestōk = yes

[Share]

; Shared Folder path

Path =/home/willis/share

; Read permissions

browseable = yes

; Write permission

writeable = yes

*************************************************************************************************************** ********

Four. test file configuration Results

# Testparm

Five. Restart Samba service

#/etc/init.d/samba Restart

Of course, the above file configuration can also be configured through the graphical interface.

Then in Windows: Run-Linux IP address, enter user name and password can be accessed.

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.