This method cannot share Linux root folders with windows!
Suppose you want to share the source folder under ubuntu in a windows Virtual Machine
Run the following command in ubuntu:
# Sudo apt-get install samba
# Sudo apt-get install smbfs
# Chmod 777 source
Sudo cp/etc/samba/smb. conf/etc/samba/smb. conf_backup
Sudo gedit/etc/samba/smb. conf
Search this line:
Security = user
Change to the following two rows:
Security = user
Username map =/etc/samba/smbusers
Add code at the end of the file:
[Source]
Comment = Yiru
Read only = no
Path =/source
Guest OK = yes
Available = yes
Browsable = yes
Public = yes
Writable = yes
The first line of [source] is the name of the folder displayed in windows, which can be retrieved at will; the second line of comment, comment, and random; the third line of needless to say; the fourth line of path, ten millions of attention, it cannot be a root folder or a folder under root.
In addition, the command to restart samba is this, but the above steps do not need to be used:
Sudo/etc/init. d/smbd restart