Lesson 7

Dates: 3/5/2014
Start-up and Run Levels. Scheduled jobs (at, cron)
Linux for Engineering and IT Applications


Exercise: VM setup for startup scripts

  • Clone kvm1 to a new NFS server VM host, run01, by executing the command below:
    virsh shutdown kvm1
    virt-clone --connect=qemu:///system -o kvm1 -n run01 -f /home/hostadm/KVM/run01.img
    
  • Check if the new VM is in the list, start it, then login to its console:
    virsh list --all
    virsh start run01
    virsh console run01
    
  • Fix the host name and the MAC address:
    remove line with "127.0.0.1 kvm1" in /etc/hosts file, then
    replace kvm1 with run01 in /etc/hostname file,
    cp /dev/null /etc/udev/rules.d/70-persistent-net.rules
    
  • Fix the upstart script for ttyS0 to allow console at run level 1 as follows: edit file /etc/init/ttyS0.conf to include '1' in the list of the run levels, [12345] and [!12345]. The configuration file now should look as follows:
    # ttyS0 - getty
    #
    
    start on stopped rc RUNLEVEL=[12345]
    stop on runlevel [!12345]
    
    respawn
    exec /sbin/getty -L 115200 ttyS0 xterm
    

    Reboot the VM:
    reboot
    
    After reboot, the new VM should come up with the correct host name and the MAC address.


  • Take me to the Course Website