Xen installation issues w/ Ubuntu 8.04 LTS server

Discussion in 'HOWTO-Related Questions' started by incgnito, May 7, 2008.

  1. incgnito

    incgnito New Member

    Hello. I've installed Ubuntu 8.04 LTS server and started to follow one of Falco's excellent Tutorials (Installing Xen On An Ubuntu 8.04 (Hardy Heron) Server From The Ubuntu Repositories) until I got to the point to issue this command:

    Code:
    xen-create-image --hostname=xen1.justfixit.org --size=10Gb --swap=1Gb --ide --ip=192.168.1.201 --netmask=255.255.255.0 --gateway=192.168.1.254 --force --dir=/home/xen --memory=512Mb --arch=1386 --install-method=debootstrap --dist=hardy --mirror=http://archive.ubuntu.com/ubuntu/ --passwd
    Unfortunately this command always fails. Looking in the log I found the following:

    Code:
    Copying files from host to image.
    Copying files from /var/cache/apt/archives -> /tmp/HesjyuhRrM/var/cache/apt/archives
    Done
    Done
    I: Retrieving Release
    E: Invalid Release file, no entry for main/binary-1386/Packages
    
    Copying files from new installation to host.
    Copying files from /tmp/HesjyuhRrM/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
    
    Any ideas? Not sure how to proceed at this point.
     
  2. incgnito

    incgnito New Member

    Update

    Okay I decided to wipe the hard drive and start over burned a different CD and started from the beginning and this time it worked. Now I'm just running into a strange thing now that I've made a guest OS and restarted the system: I can't get to a login prompt on tty1. I can go to any other screen (alt+ctrl+F2 for example) and I can login as normal in any one of those, but as for the first console it hangs on "Running local boot scripts (/etc/rc.local)" which it gives "OK" to but then goes to the next line and stops. That's it. There's nothing in syslog to indicate anything wrong, dmesg doesn't show anything that throws up red flags, but I am getting one message about three lines up before the rc.local step that says:

    There's nothing in rc.local besides "exit 0" and I've checked and networking works in both the host and guest so I'm not sure how to proceed here. Again, ideas?
     
  3. falko

    falko Super Moderator Howtoforge Staff

    I got the same behaviour; you can simply type your username and password and log in. I think the login prompt is hidden somewhere in all the boot messages - this has been happening since Ubuntu introduced upstart which means you can log in while some services haven't started yet/are currently starting.
     
  4. ralic

    ralic New Member

    In case it happens again and you're wondering why, it was the --arch= component of your create statement. Should be --arch=i386 where you had --arch=1386
     
  5. ralic

    ralic New Member

    Suffered the same problem. Now fixed.
    Not sure where yet, but something replaces the host machine's /etc/event.d/tty1 file with one that spawns /sbin/getty on xvc0

    Probably useful for the guest, but not so much for the host.

    Quick and dirty fix is to replace the xvc0 on the last line with tty1. Hopefully those better equipped will pick this up and make a proper fix.

    Falko, thanks for that excellent guide!
     
    Last edited: Jun 3, 2008
  6. ralic

    ralic New Member

    Seems the startup/shutdown script is also broken. Not sure why no-one's noticed this tho.

    When shutting down the host, or executing /etc/init.d/xendomains stop the following results:
    Code:
    root@xenux001:/etc/init.d# xm list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0  2497     2     r-----     61.3
    xen1.xenland.net                             1   512     1     -b----      9.6
    
    root@xenux001:/etc/init.d# /etc/init.d/xendomains stop
    Shutting down Xen domains:cut: cut: No such file or directory
    /etc/init.d/xendomains: line 313: test: =: unary operator expected
     Domain-0(save).Error: 'xm save' requires between 2 and 3 arguments.
    
    Usage: xm save [-c] <Domain> <CheckpointFile>
    
    Save a domain state to restore later.
      -c, --checkpoint               Leave domain running after creating        
                                     snapshot
    
    !(shut).Error: No domain parameter given
    /etc/init.d/xendomains: line 305:  5228 Terminated              watchdog_xm save
    !cut: cut: No such file or directory
    /etc/init.d/xendomains: line 187:  5238 Terminated              watchdog_xm shutdown
    /etc/init.d/xendomains: line 313: test: =: unary operator expected
     xen1.xenland.net(save)/etc/init.d/xendomains: line 305:  5238 Terminated              watchdog_xm shutdown
    .Error: 'xm save' requires between 2 and 3 arguments.
    
    Usage: xm save [-c] <Domain> <CheckpointFile>
    
    Save a domain state to restore later.
      -c, --checkpoint               Leave domain running after creating        
                                     snapshot
    
    !(shut).Error: No domain parameter given
    /etc/init.d/xendomains: line 305:  5254 Terminated              watchdog_xm save
    !cut: cut: No such file or directory
    /etc/init.d/xendomains: line 187:  5264 Terminated              watchdog_xm shutdown
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
     SHUTDOWN_ALL .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .Domain xen1.xenland.net terminated
    cut: cut: No such file or directory
    /etc/init.d/xendomains: line 271: test: =: unary operator expected
    .All domains terminated
    /etc/init.d/xendomains: line 305:  5264 Terminated              watchdog_xm shutdown
    /etc/init.d/xendomains: line 305:  5284 Terminated              watchdog_xm shutdown 1
     *   [done] 
    
    root@xenux001:/etc/init.d# xm list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0  2497     2     r-----     66.9
    Line 186 of /etc/init.d/xendomains has a repeated cut statement:
    Code:
    rest=`echo "$1" | cut cut -d\  -f2-`
    Here's a quick patchfile to fix it:
    Code:
    --- xendomains  2008-06-04 21:21:55.000000000 +0200
    +++ xendomains.fix      2008-06-04 21:23:06.000000000 +0200
    @@ -183,7 +183,7 @@
     {
         name=`echo "$1" | cut -d\  -f1`
         name=${name%% *}
    -    rest=`echo "$1" | cut cut -d\  -f2-`
    +    rest=`echo "$1" | cut -d\  -f2-`
         read id mem cpu vcpu state tm < <(echo "$rest")
     }
    Save it as xendomains-patch in /etc/init.d and implement with:
    Code:
    cd /etc/init.d
    patch -p0 <xendomains-patch
    After the patch, it seems much more elegant:
    Code:
    root@xenux001:/etc/init.d# xm list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0  2497     2     r-----     75.9
    xen1.xenland.net                             2   512     1     -b----      9.6
    
    root@xenux001:/etc/init.d# /etc/init.d/xendomains stop
    Shutting down Xen domains: xen1.xenland.net(save).............../etc/init.d/xendomains: line 187:  5874 Terminated              watchdog_xm save
    /etc/init.d/xendomains: line 305:  5874 Terminated              watchdog_xm save
     *   [done] 
    root@xenux001:/etc/init.d#
    Here is a link to the bug report on launchpad
     
    Last edited: Jun 5, 2008
  7. ralic

    ralic New Member

    Ok, so this happens because of an error in the hook script named 100-ubuntu-setup

    And it's going to affect all the ubuntu distro's because the hook scripts for each one is just a symlink to the files in edgy.

    To fix, edit /usr/lib/xen-tools/edgy.d/100-ubuntu-setup, replacing:
    Code:
    prefix=$[b]i[/b]
    with:
    Code:
    prefix=$[b]1[/b]
    If this isn't fixed you will hit this problem each time that you use xen-create-image to create a new guest on the host.

    Here is a link to the bug report on launchpad
     
    Last edited: Jun 5, 2008

Share This Page