This page describes how to create a Linux base image.

Requirements

  • Computer being captured has been added to the VCL database
  • Computer has been installed with Linux
  • Two network adapters are enabled on the computer:
    • eth0 - connected to the private network
    • eth1 - connected to the public network
  • The ability to log in as root via SSH using an identity key on the private network from management node

Configure SSH Identity Key Authentication

  1. On the Linux computer being captured, create a /root/.ssh directory:

    mkdir /root/.ssh

  2. On the management node, copy the public SSH identity key to the authorized_keys file on the Linux computer being captured:

    scp /etc/vcl/vcl.key.pub <hostname or IP address>:/root/.ssh/authorized_keys

  3. Or replace the above two steps with the following on the management node:

    ssh-copy-id -i /etc/vcl/vcl.key <hostname or IP address>

  4. Make sure you can login from the management node to the Linux computer being captured using the identity key:

    ssh -i /etc/vcl/vcl.key <hostname or IP address>

Configure the ifcfg-* Files

  1. Navigate to the network-scripts directory:

    cd /etc/sysconfig/network-scripts

  2. Delete any ifcfg-*.bak files:

    rm -f /etc/sysconfig/network-scripts/ifcfg-*.bak

  3. Edit every ifcfg-eth* file in the network-scripts directory. Remove the HWADDRESS= line:

    vi ifcfg-eth0

    vi ifcfg-eth1

    The ifcfg-eth0 file should contain the following:
    DEVICE=eth0
    BOOTPROTO=dhcp
    ONBOOT=yes
    
    The ifcfg-eth1 file should contain the following:
    DEVICE=eth1
    BOOTPROTO=dhcp
    ONBOOT=yes
    
  4. Reboot the computer:

    shutdown -r now

  5. Check the ifcfg-eth* files to make sure there are no ifcfg-eth* files and that the HWADDRESS= lines have not been automatically added back:

    ls /etc/sysconfig/network-scripts

    cat /etc/sysconfig/network-scripts/ifcfg-eth0

    cat /etc/sysconfig/network-scripts/ifcfg-eth1

Run vcld -setup

  1. Run the following command on the management node:

    /usr/local/vcl/bin/vcld --setup

  2. Navigate the menu options
    (Note: the names and numbers of the menu items may not match your installation):
    1. Choose an operation: Image Management → Capture Base Image
    2. Enter the VCL login name or ID of the user who will own the image:
      Enter your VCL user ID or the user ID of the user you want to own the image.  Pressing Enter without entering a user login ID will cause admin to be the owner of the new base image.
    3. Enter the hostname or IP address of the computer to be captured:
      Enter the name or private IP address of the computer which has already added to the VCL database.
    4. Select the OS to be captured (NOTE in the list, VMware means virtual and is not specific to the VMware hypervisor):
      1. Generic Linux (VMware)
      2. OSX Snow Leopard (VMware)
      3. Ubuntu (VMware)
      4. Windows 10.x (VMware)
      5. Windows 2003 Server (VMware)
      6. Windows 7 (VMware)
      7. Windows 8.x (VMware)
      8. Windows Server 2008 (VMware)
      9. Windows Server 2012 (VMware)
      10. Windows Server 2016 (VMware)
      11. Windows Vista (VMware)
      12. Windows XP (VMware ESX)
      13. Windows XP (VMware)
    5. Image architecture:
      1. x86
      2. x86_64
    6. Use Sysprep:
      1. Yes
      2. No
      Sysprep is usually only required if the image will be loaded on bare metal computers with varying different hardware.
    7. Enter the name of the image to be captured:
      The name you enter is the name that will be displayed in the list of environments.  It may contain spaces but including other special characters is not recommended.

The following happens once you enter an image name and press enter:

  • A new image is added to the VCL database
  • An imaging request is added to the VCL database
  • The vcld -setup automatically initiates 'tail -f /var/log/vcld.log' to monitor the vcld log file.  The output will be displayed on the screen for several seconds and then tail will be stopped. However, the capture process will continue. Manually running 'tail -f /var/log/vcld.log' will allow you to continue monitoring the capture process.

Watch the vcld logfile output to determine if the image capture process is successful or terminated because a problem occurred.  When the capture process terminates, there will either be a message near the end of the output saying "image capture successful" or there will be several WARNING messages, the last of which says something to the effect "image failed to be captured".  Further troubleshooting is required if the image fails to be captured.

Add the Base Image to an Image Group

The vcld -setup utility does not add the new base image to any image groups.  You must add the image to an image group using the VCL website after the image capture process is complete.  Reservations for the image cannot be made until this is done.  To add the image to an image group, browse to the VCL website and select Manage Images > Edit Image Grouping.

  • No labels

2 Comments

  1. I think you should add a section to this. Make sure that sshd is set to automaticaly on on your Linux Image

    su -
    Log in as root for the image you are working on
    Password:
    Turn on sshd by typing /etc/init.d/sshd start
    Got to the /etc/init.d/ then type chkconfig sshd on
    root@localhost ~#
    This will trigger sshd to be automatically on on your next reboot

  2. Make sure you have the correct /.ssh/authorized_keys
    I like to check by doing a CAT /.ssh/authorized_keys and making sure my key file is there.

    GET SSH to work correctly on linux check list

    You want to make sure to chmod the directions

    /.ssh/authorized_keys will be 600
    TYPE chmod 600 ~/.ssh/authorized_keys
    /.ssh will be 700
    TYPE chmod 700 ~/.ssh

    chmod go-w ~/ ; chmod 700 ~/.ssh ; chmod 600 ~/.ssh/authorized_keys

    Also make sure to vim your /etc/ssh/sshd_config
    The only things that should be # are
    Everything Under #Accept localte-ratlated enivorment

    IN the /etc/ssh/sshd_config make sure to delete the # and set these settings.
    UsePAM yes
    GSAPIAhtentication yes
    GSSAPICLeanupCredentails YES
    PasswordAuthentication YES
    ChallengeResponseAuthentication no
    Saves your changes to te sshd_config file
    !wq
    Then restart sshd
    /etc/init.d/sshd restart