CentOS DomU on Ubuntu 8.04 LTS Dom0

Discussion in 'HOWTO-Related Questions' started by atjensen11, Feb 7, 2009.

  1. atjensen11

    atjensen11 New Member

    I have been following the tutorial referenced here.

    http://www.howtoforge.com/create-centos5.2-domu-on-ubuntu-hardy-dom0

    Now there are lots of typos and errors in the tutorial, but I managed to overcome them. Upon creating the CentOS DomU, I do get a login prompt and can login.

    The first issue I had was that I couldn't get any updates or install packages. I thought it was a DNS issue. But after fixing that, I noticed I couldn't even ping.

    Typing ifconfig at the command prompt, I noticed that eth0 has a MAC address, but no IP. I did follow the tutorial on specifying the IP. I also tried specifying it in the Xen config file for the DomU.

    Regardless of which method I try, I get an error message upon starting the DomU that says another host already has claimed this IP address. I know for a fact that is not the case. I have changed the IP address too and no matter what I change it to, I get the same error message.

    Any ideas of where to look next?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    I haven't tried that tutorial, but I'd use xen-tools for creating guests. They also support creating CentOS guests.
     
  3. atjensen11

    atjensen11 New Member

    I tried your suggestion tonight of using xen-tools. First, I looked under /usr/lib/xen-tools and saw two CentOS related directories: centos-4.d and centos-5.d.

    So I assumed that when creating the DomU using xen-tools, I would use the parameter:

    Code:
    --dist=centos-5
    
    However, the installation failed. Below is the sanitized result of the log file.

    Code:
    General Information
    --------------------
    Hostname       :  centos-5.example.com
    Distribution   :  centos-5
    Partitions     :  swap            256Mb (swap)
                      /               10Gb  (ext3)
    Image type     :  sparse
    Memory size    :  256Mb
    Kernel path    :  /boot/vmlinuz-2.6.24-23-xen
    Initrd path    :  /boot/initrd.img-2.6.24-23-xen
    
    Networking Information
    ----------------------
    IP Address 1   : 192.168.100.103 [MAC: 00:16:3E:XX:XX:XX]
    Netmask        : 255.255.255.0
    Broadcast      : 192.168.100.255
    Gateway        : 192.168.100.1
    
    Creating partition image: /home/xen/domains/centos-5.example.com/swap.img
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 4.1828e-05 s, 0.0 kB/s
    Done
    
    Creating swap on /home/xen/domains/centos-5.example.com/swap.img
    Setting up swapspace version 1, size = 268431 kB
    no label, UUID=76fa5bc5-1262-4ec1-975e-f1e735698c1a
    Done
    
    Creating partition image: /home/xen/domains/centos-5.example.com/disk.img
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 4.521e-05 s, 0.0 kB/s
    Done
    
    Creating ext3 filesystem on /home/xen/domains/centos-5.example.com/disk.img
    mke2fs 1.40.8 (13-Mar-2008)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    655360 inodes, 2621440 blocks
    131072 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=2684354560
    80 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
    
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    This filesystem will be automatically checked every 27 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
    Done
    Installation method: debootstrap
    Falling back to default debootstrap command
    
    Copying files from host to image.
    Copying files from /var/cache/apt/archives -> /tmp/aG2vqt910a/var/cache/apt/archives
    Done
    Done
    E: No such script: /usr/share/debootstrap/scripts/centos-5
    
    Copying files from new installation to host.
    Copying files from /tmp/aG2vqt910a/var/cache/apt/archives -> /var/cache/apt/archives
    Done
    Done
    The installation of the new system has failed.
    
    The system is missing the common file: /bin/ls
    Done
    System installation failed.  Aborting
    
    I get a similar error when trying a CentOS 4 DomU as well.
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Please use rpmstrap instead of debootstrap (that tool is only for Debian/Ubuntu).
     
  5. atjensen11

    atjensen11 New Member

    So I changed the --install-method parameter to be rpmstrap instead of the default debootstrap.

    Now I receive the following error:
    Code:
    Installation method: rpmstrap
    The following required binary for the installation was not found
            /usr/bin/rpmstrap
    Done
    System installation failed.  Aborting
    
    I googled around and found many references to rpmstrap being broken in Gutsy. I am running the Hardy (8.04 LTS) server version.

    I also did an apt-cache search for the rpmpackage, but nothing was found using the standard repositories. On the Ubuntu site, I could only find the package mentioned in the Gutsy and Gutsy-updates listings.
     
  6. falko

    falko Super Moderator ISPConfig Developer

    If rpmstrap doesn't work, you can also use rinse. There's a rinse package for Hardy. Of course, you must configure xen-tools to use rinse instead of rpmstrap.
     
  7. atjensen11

    atjensen11 New Member

    So I installed rinse and the dependency package rpm.

    The xen-create-image command appeared to work great without any errors. However, when starting the DomU using the -c parameter to go into the console, a prompt appears requiring me to log in for Maintenance.

    I don't know the default password. When the xen-create-image was running, it stated that there is no passwd command in the centos-5 package and so the password was not changed when the image was created.

    Any suggestions?
     
  8. falko

    falko Super Moderator ISPConfig Developer

    What's in the xen-tools log?
     
  9. atjensen11

    atjensen11 New Member

    Here is a snippet of the xen-tools log file for this DomU. Everything above this point was successful (creation of LVM on Dom0, IP addresses, etc.)

    Code:
    Running post-install script post-install.sh:
      Creating resolv.conf
    [: 32: ==: unexpected operator
    BUGFIX
      Mounting /proc
      Bootstrapping yum
      Authfix
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
    chroot: cannot run command `/usr/bin/authconfig': No such file or directory
      Cleaing up
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
      Final tidy...
    Installation complete.
    Done
    
    Running hooks
    Running hook 10-disable-tls
    hook 10-disable-tls: done.
    Running hook 20-setup-yum
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
    hook 20-setup-yum: done.
    Running hook 30-disable-gettys
    hook 30-disable-gettys: done.
    Running hook 35-setup-users
    hook 35-setup-users: done.
    Running hook 40-setup-networking
    hook 40-setup-networking: done.
    Running hook 50-setup-hostname
    hook 50-setup-hostname: done.
    Running hook 55-create-dev
    /bin/sh: ./MAKEDEV: No such file or directory
    /bin/sh: ./MAKEDEV: No such file or directory
    /bin/sh: ./MAKEDEV: No such file or directory
    mknod: missing operand after `202'
    Try `mknod --help' for more information.
    mknod: missing operand after `202'
    Try `mknod --help' for more information.
    mknod: missing operand after `202'
    Try `mknod --help' for more information.
    mknod: `/dev/xvc0': File exists
    hook 55-create-dev: done.
    Running hook 60-copy-host-files
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
    hook 60-copy-host-files: done.
    Running hook 65-copy-user-files
    hook 65-copy-user-files: done.
    Running hook 70-install-ssh
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
    hook 70-install-ssh: done.
    Running hook 75-fixup-securetty
    hook 75-fixup-securetty: done.
    Running hook 80-install-modules
    hook 80-install-modules: done.
    Running hook 90-make-fstab
    hook 90-make-fstab: done.
    Running hook 99-clean-image
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named sqlitecachec
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.4.3 (#1, May 24 2008, 13:47:28) 
    [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://wiki.linux.duke.edu/YumFaq
      
    
    hook 99-clean-image: done.
    Done
    
    No role scripts were specified.  Skipping
    
    Creating Xen configuration file
    Done
    Setting up root password
    'passwd' command not found in the new install.
    All done
    
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Can you try to mount the image, chroot to it and run passwd manually?
     
  11. atjensen11

    atjensen11 New Member

    Sorry Falko, but I don't know how to do what you are asking. I only have about a year on Linux, all with Ubuntu.

    There are some things I can do and have been able to figure out on my own, but I don't know where to start with your request.

    Are you asking me to mount the root LVM partition of the CentOS DomU somewhere on Dom0?
     
  12. falko

    falko Super Moderator ISPConfig Developer

    Yes, like this:
    Code:
    mount /dev/vg0/vm1 /mnt
    chroot /mnt
    passwd
    (Replace /dev/vg0/vm1 with the correct volume.)
     
  13. atjensen11

    atjensen11 New Member

    Sorry, but this is what I get when I chroot into the LV for the CentOS DomU and issue the passwd command:

    Code:
    bash-3.2# passwd
    bash: passwd: command not found
    
     
  14. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    yum search passwd
    ?
     
  15. atjensen11

    atjensen11 New Member

    Here is the output of yum search passwd when the DomU is mounted and chroot.

    Code:
    bash-3.2# yum search passwd
    Traceback (most recent call last):
      File "/usr/bin/yum", line 4, in ?
        import yum
      File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 37, in ?
        import rpmsack
      File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 24, in ?
        from packages import YumInstalledPackage
      File "/usr/lib/python2.4/site-packages/yum/packages.py", line 31, in ?
        import rpmUtils.arch
      File "/usr/lib/python2.4/site-packages/rpmUtils/arch.py", line 273, in ?
        canonArch = getCanonArch()
      File "/usr/lib/python2.4/site-packages/rpmUtils/arch.py", line 269, in getCanonArch
        return getCanonX86_64Arch(arch)
      File "/usr/lib/python2.4/site-packages/rpmUtils/arch.py", line 232, in getCanonX86_64Arch
        f = open("/proc/cpuinfo", "r")
    IOError: [Errno 2] No such file or directory: '/proc/cpuinfo'
    
    It looks like an error with /proc/cpuinfo, but I don't know how to proceed. Up until now, I have been an apt-get and not a yum guy. This is really my first exposure to CentOS and it is through my Xen machine.
     
  16. falko

    falko Super Moderator ISPConfig Developer

    Hm... I've never tried to install CentOS with xen-create-image. Seems as if there are still a few bugs.

    Have you tried to install the latest xen-tools package directly from the xen-tools web site? Maybe it works with that version.
     
  17. atjensen11

    atjensen11 New Member

    I haven't tried that yet, but I could.

    I guess I could back up a step here and explain why I am trying to install CentOS. I was really hoping to install HyperVM on a DomU to test the management of my Xen virtual machines.

    In my network, all servers are Linux servers and they run headless. Therefore, it appears that others I have tried such as Virt-Manager required some kind of graphic desktop environment to be enabled on the server.

    The client machines on the network are all Windows XP machines. Most of the server management is done from these Windows machines through SSH.

    Has anyone had any luck in installing a Xen management console on a Windows machine? One option I thought about was using a live CD or USB key an effectively run a Linux environment on the Windows machine temporarily to manage Xen.

    Thoughts?
     
  18. falko

    falko Super Moderator ISPConfig Developer

    The tools that I know are all Linux-based... (that doesn't mean there isn't a cool Windows tool out there).
     

Share This Page