"Go" win7 virtual machine VirtualBox ubuntu12.04 Install Samba for file sharing

Source: Internet
Author: User

Original URL: http://blog.csdn.net/watkinsong/article/details/8878786

Yesterday, a whim, and installed a virtual machine, and then install the ubuntu12.04, in order to achieve in the virtual machine and Win7 file sharing, you get the next Samba

First summarize the following points: generally we in the VirtualBox network settings are NAT, in order to let the virtual machine use host Internet, but NAT is no way to use samba, yesterday tried for a long time, in the NAT changed to bridge network can be, in addition, Many tutorials say that finding shared folders in My Network Neighborhood is not an easy thing to find in Win7, and I'm not looking for it. Accessing the shared folder in Win7 should be the Ubuntu IP that entered your virtual machine in the Run window, enter ifconfig in Ubuntu to view the IP, and then enter the Win7 in the run:

\\192.168.111.2 here is your Ubuntu IP, check it yourself, and then you can open the shared folder, then you will need to enter the account password and so on.

Samba Configuration method:

Installing Samba

Installing Samba

sudo apt-get install Samba

[edit]Kubuntu

Sharing module for installing system settings

sudo apt-get install kdenetwork-filesharing

[edit] configuration

1.windows access to Ubuntu

The first step is to create a shared directory: for example, to create a/home/user name/share first create this folder (this user name is your user name, in order to make it easy to understand I wrote, I remember to change AH)

Code:

mkdir/home/User name/share    (new share folder)
chmod 777/home/User name/share   (set permissions on this folder so that all users can read and write to run)

Backing up and editing smb.conf allows network users to access (develop a good habit of backing up at any time, and at the critical time you'll find out how smart the backup was!) Code

sudo cp/etc/samba/smb.conf/etc/samba/smb.conf_backup
sudo gedit/etc/samba/smb.conf

Search for this line of text code:

; Security = User

Replace them with the following lines

Code:

Security = User
Username map =/etc/samba/smbusers

Add the following lines to the last side of the file, assuming that the user allowed access is: new. and the folder's share name is Share # This is because we're going to create an SMB user new and let XP users use this new to communicate with us. Of course, you can write your favorite name just to be consistent.

Code:

[Share]

Comment = Shared Folder with username and password

Path =/home/User name/share

Public = yes

writable = yes

Valid users = new

Create mask = 0700

Directory mask = 0700

force user = Nobody

Force Group = Nogroup

Available = yes

browseable = yes

Then change this here and find [global] to change workgroup = Mshome to: (Note that the workgroup here is the workgroup name in the share) code:

Workgroup = Workgroup

Display CharSet = UTF-8

Unix CharSet = UTF-8

DOS charset = cp936


The following three lines are intended to prevent the occurrence of garbled Chinese catalogs. Now you want to add the new network Access account. If the account is not currently present in the system, then the code:

sudo useradd new


Note that the above only adds the new user, but does not give the user a native login password. So this user will only be able to access from remote, cannot log on from native. And Samba's login password may not be the same as the native login password. Now you want to add the network user's account:

Code:

sudo smbpasswd-a new (Set your new password, this password is not used at the boot logon time, is the password you want to access the win share file or the win share file to access your time)

sudo gedit/etc/samba/smbusers


Add the following line to the newly created file and save

Code:

New = "Network username"

If you need to change the new network access password in the future, use this command to change

Code:

sudo smbpasswd-a new

The command to delete the network user's account change the top-A to-x sudo smbpasswd-x new

Test and restart Samba

Code:

sudo testparm

When you enter the above command, it is possible to "execute the child process" Testparm "failed without the file or directory" at this point you want to re-enter the command: Apt-get install samba-common-bin This problem can be resolved the input restart command: sudo/ ETC/INIT.D/SMBD restart

Then enter in the run in Win7: \\ubuntu IP Address for example: \\192.168.3.3

"Go" win7 virtual machine VirtualBox ubuntu12.04 Install Samba for file sharing

Related Article

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.