Using FOG to PXE boot into your favorite installer images

  • Moderator

    Installing SAMBA on the FOG Server
    In this section we’ll setup samba on your fog server. This will give your WinPE environment access to the MS Windows images we stored in the /images/os/mswindows directory. You could use a traditional MS Windows server for this function and skip the entire samba setup. That decision is up to you. I’m documenting the process of enabling CIFS (windows file share access) on your fog server to provide a consistent place to store your imaging files. In this setup the samba file shares will be share as read only and can only be access by the user account we will setup in this post. SAMBA will not be connected to your AD. AD users will not be able to mount or access these shares. Your FOG server will be a standalone server with its own access control and users.

    Centos 7 Instructions:

    yum install samba samba-common samba-winbind 
    systemctl enable smb
    systemctl enable winbind
    systemctl enable nmb
    # Create a linux user called fogpxeu we will use this account to connect to
    # the server from our WinPE environment. 
    adduser --no-create-home --shell /sbin/nologin --user-group fogpxeu
    # Assign a complex password since we will never use it we will use
    # the samba password we will define below.
    passwd fogpxeu
    mv /etc/samba/smb.conf /etc/samba/smb.conf.old

    We need to create our custom config file for samba. So use your favorite text editor and edit /etc/samba/smb.conf. My favorite is vi.

    vi /etc/samba/smb.conf

    Insert the following text into the smb.conf file.

    workgroup = FOGPXE
    server string = Fog Project Imaging
    log file = /var/log/samba/log.%m
    max log size = 50
    idmap config * : backend = tdb
    cups options = raw
    netbios name = fogpxeserver
    map to guest = bad user
    dns proxy = no
    public = yes
    nt acl support = no
    security = user
    guest account = nobody
       path = /images/os/mswindows/7Pro-x64
       comment = Windows 7 OEM Installation DVD
       valid users = "fogpxeu"
       writeable = no
       browseable = yes
       read only = yes
       path = /images/os/mswindows/10-1607
       comment = Windows 10 1607 Installation DVD
       valid users = "fogpxeu" 
       writeable = no
       browseable = yes
       read only = yes

    Now lets start the samba services

    systemctl restart smb
    systemctl restart winbind
    systemctl restart nmb
    systemctl status smb
    # Define the password here  you will use to connect to the network
    # share from the WinPE environment. Document this password, 
    # you will need it when you setup your WinPE boot image. 
    smbpasswd -a 'fogpxeu'
    $ New SMB password:
    $ Retype new SMB password:
    $ Added user fogpxeu.

    Ubuntu Instructions:
    <Coming Soon>

    Testing to setup:
    Lets see if the shares are visible from a windows computer. On your favorite windows computer, open a command window and key in the net view command.

    C:\Users\admin>net view \\
    Shared resources at \\
    Fog Project Imaging
    Share name  Type  Used as  Comment
    win10-1607  Disk           Windows 10 1607 Installation DVD
    win7oem     Disk           Windows 7 OEM Installation DVD
    The command completed successfully.

    Nice! we can see our shares. Now lets see if we can mount the network share. From the same command window used above key in the following.

    C:\Users\admin>net use t: \\\win10-1607  /user:fogpxeu
    Enter the password for 'fogpxeu' to connect to '':
    The command completed successfully.

    Double nice!! We are able to map the drive as the fogpxeu user. Lets see if we can see any files on the share.

    C:\Users\admin>dir t:
     Volume in drive T is win10-1607
     Volume Serial Number is B512-AE19
     Directory of T:\
    10/13/2017  01:50 PM    <DIR>          .
    10/13/2017  09:35 PM    <DIR>          ..
    10/13/2017  01:50 PM    <DIR>          boot
    10/13/2017  01:51 PM    <DIR>          sources
    10/13/2017  01:50 PM    <DIR>          efi
    10/13/2017  01:48 PM               135 readme.txt
    10/13/2017  01:50 PM         1,152,864 bootmgr.efi
    10/13/2017  01:50 PM           395,268 bootmgr
                   3 File(s)      1,548,267 bytes
                   5 Dir(s)  34,709,315,584 bytes free

    Great!! we can mount the share and can view the contents. The last bit is to disconnect from the share since our test was successful.

    net use t: /delete

Log in to reply