Configuring Samba File (smb.conf) for sharing linux folders into windows KVM

Default Path of Samaba in Redhat Enterprise linux 6: /etc/samba/
Default Samba file (smb.conf) contains the following in my linux Machine:

[global]
    ## OPENCLIENT GLOBAL KVM CONFIG ##
        workgroup = LINUXKVM
        server string = Samba Server Version %v
        interfaces = lo virbr0
        log file = /var/log/samba/log.%m
        max log size = 50
        security = share
        load printers = yes
        cups options = raw
[shared_ammar_rasheed]
    ## OPENCLIENT SHARE KVM CONFIG ##
        comment = Temporary file space
        path = /home/ammar_rasheed
        read only = no
        public = yes
        guest ok = yes
        guest only = yes
        browseable = yes
        force user = ammar_rasheed
        create mask = 0777
        directory mask = 0777
        guest ok = Yes

        # OPENCLIENT RECYCLER
        vfs object = recycle:recycle
        recycle:subdir_mode = 0770
        recycle:repository = Recycle Bin
        recycle:keeptree = Yes
        recycle:touch = Yes
        recycle:versions = True
        recycle:maxsize = 500000000



In above configuration, a path of "/home/ammar_rasheed" is already shared with Windows KVM.
In order to add a more path, simply add the following section after "[shared_ammar_rasheed]" in above file :

[shared_ammar_partition_2]
    ## OPENCLIENT SHARE KVM CONFIG ##
        comment = Temporary file space
        path = /media/Ammar
        read only = no
        public = yes
        guest ok = yes
        guest only = yes
        browseable = yes
        force user = ammar_rasheed
        create mask = 0777
        directory mask = 0777
        guest ok = Yes



Here the new path is : /media/Ammar

so our new smb.conf file will become:

[global]
    ## OPENCLIENT GLOBAL KVM CONFIG ##
        workgroup = LINUXKVM
        server string = Samba Server Version %v
        interfaces = lo virbr0
        log file = /var/log/samba/log.%m
        max log size = 50
        security = share
        load printers = yes
        cups options = raw
[shared_ammar_rasheed]
    ## OPENCLIENT SHARE KVM CONFIG ##
        comment = Temporary file space
        path = /home/ammar_rasheed
        read only = no
        public = yes
        guest ok = yes
        guest only = yes
        browseable = yes
        force user = ammar_rasheed
        create mask = 0777
        directory mask = 0777
        guest ok = Yes

[shared_ammar_partition_2]
    ## OPENCLIENT SHARE KVM CONFIG ##
        comment = Temporary file space
        path = /media/Ammar
        read only = no
        public = yes
        guest ok = yes
        guest only = yes
        browseable = yes
        force user = ammar_rasheed
        create mask = 0777
        directory mask = 0777
        guest ok = Yes

        # OPENCLIENT RECYCLER
        vfs object = recycle:recycle
        recycle:subdir_mode = 0770
        recycle:repository = Recycle Bin
        recycle:keeptree = Yes
        recycle:touch = Yes
        recycle:versions = True
        recycle:maxsize = 500000000


TIPS:
 smb.conf file is "read-only". so the best practice to edit it is to copy it from default location to somewhere else, then edit it in the new location, then copy (overwrite) it back to its default origional location.

Comments

Popular posts from this blog

Huawei - eNSP (Enterprise Network Simulation Platform)

Useful Websites & Forums (Non-IT)

Useful Websites & Forums (IT/Technical/Educational)

Internet Traffic Generators

Network/Telecom Vendors (National & International)

Create iSCSI Share via FreeNAS - Step by Step

Cisco Simulator: Cisco IOS-On-UNIX (Cisco IOU)

Cisco IOS Collection