no xm console prompt after debootstrap debian or ubuntu

Bug #139046 reported by Marsu42 on 2007-09-12
12
Affects Status Importance Assigned to Milestone
xen (Ubuntu)
Undecided
Unassigned
xen-tools (Ubuntu)
Low
Unassigned

Bug Description

xen-tools 3.5-1, gutsy tribe-6:

When creating a debian or ubuntu xen domu with xen-create-image and activating the domain, everything is ok except there is no prompt after running xm console. Only ssh connection is possible.

Searching the web, I found two possible solutions:
1. in the domu, in /etc/inittab replace tty1 with xvc0 (it is modified by xen-tools e.g. via /usr/lib/xen-tools/edgy.d/30-disable-gettys), and add xvc0 to /etc/securetty
2. in the domain config file, add extra='xencons=tty1'. However, this solutions seems to disable the vfb in the domu (to which could not connect to anyway yet :-o)

TiagoMacambira (macambira) wrote :

I can confirm this bug on xen-tools version 3.1-1ubuntu1 for edgy guests.

This is a rather silly bug, though. The problem is in file 30-disable-gettys (/usr/lib/xen-tools/edgy.d/), in the following lines::

  #
  # Remove the links for upstart
  #
  rm ${prefix}/etc/event.d/tty[^1]

The command above would be perfectly correct in a bash shell! But this script uses /bin/bash, which in turn is a sym-link to dash. In dash, the command above would remove ONLY ${prefix}/etc/event.d/tty[^1], leaving all the other tty*.* files intact. Without a login process attached to tty1 there would be no login prompt after running xm console.

POSSIBLE FIXES:

 1. use the command bellow:

    find ${prefix}/etc/event.d -name 'tty?' | grep -v tty1 | xargs rm -v

 2. use bash instead of /bin/sh in this script.

WORKAROUNDS:

1. Mont the guest image disk so you can edit its files directly. The guest vm should not be running.

export GUEST=/tmp/guest
mkdir ${GUEST}
sudo mount -o loop /home/xen/domains/you_xen_guest_hostname_here/disk.img ${GUEST}

 2. Add the tty1 file bak

cat ${GUEST}/etc/event.d/tty2 | sed -e 's/tty2/tty1/' > ${GUEST}/etc/event.d/tty1

 3. Umount your guest image

cd /tmp
sudo umount ${GUEST}

Alvin Cura (alvinc) wrote :

I think we may be chasing the wrong problem by pursuing xen-tools for the fix.

This problem is also 100% reproducible using manual domain creation.

The only working fix I have found is to add extra='xencons=tty1' to the xendomu config file.

This would be incorrect behaviour. It should work out-of-the-box.

My method for creating the xendomu was using a self-written script as follows:

#!/bin/sh
######################################################################
# $Id: //depot/hosts/xen1/root/mkxenvm#3 $
# $DateTime: 2007/10/16 10:45:21 $
######################################################################

usage()
{
        printf "USAGE: ${0}\t<xendom> <xen volume group>\n"
        printf " \t\t[root part size] [swap part size]\n"
        exit
}

if [ -z ${1} ]; then usage; else xendomu=${1}; fi
if [ -z ${2} ]; then usage; else xenvg=${2}; fi
if [ -z ${3} ]; then rootsize="8G"; else rootsize=${3}; fi
if [ -z ${4} ]; then swapsize="2G"; else swapsize=${4}; fi

printf "Creating root volume /dev/${xenvg}/${xendomu}_root with size ${rootsize}: "
lvcreate -L${rootsize} -n${xendomu}_root ${xenvg}
printf "done.\n"

printf "Creating swap volume /dev/${xenvg}/${xendomu}_swap with size ${swapsize}: "
lvcreate -L${swapsize} -n${xendomu}_swap ${xenvg}
printf "done.\n"

printf "Creating ext3 filesystem on /dev/${xenvg}/${xendomu}_root: "
mkfs.ext3 -L${xendomu}_root /dev/${xenvg}/${xendomu}_root
printf "done.\n"

printf "Creating swap partition on /dev/${xenvg}/${xendomu}_swap: "
mkswap /dev/${xenvg}/${xendomu}_swap
printf "done.\n"

printf "Mounting /dev/${xenvg}/${xendomu}_root on /tmp/${xendomu}: "
mkdir /tmp/${xendomu}

printf "Debootstrapping ${xendomu}: "
debootstrap gutsy /tmp/${xendomu}
printf "done.\n"

printf "Copying modules to ${xendomu}: "
cp -r /lib/modules/`uname -r` /tmp/${xendomu}/lib/modules/
printf "done.\n"

printf "Setting up fstab: "
printf "/dev/sda1\t/\t\text3\trw,errors=remount-ro\t0\t1\n" >> /tmp/${xendomu}/etc/fstab
printf "/dev/sda2\tnone\t\tswap\tdefaults\t0\t0\n" >> /tmp/${xendomu}/etc/fstab
printf "none\t\t/proc\t\tproc\trw,nosuid,noexec\t0\t0\n" >> /tmp/${xendomu}/etc/fstab
printf "done.\n"

printf "Setting up hostname: "
echo "${xendomu}" > /tmp/${xendomu}/etc/hostname

printf "done.\n"

printf "Setting up hosts: "
printf "127.0.0.1\tlocalhost\n" > /tmp/${xendomu}/etc/hosts
printf "done.\n"

printf "Setting up network interfaces: "
printf "auto lo\n" >> /tmp/${xendomu}/etc/network/interfaces
printf "iface lo inet loopback\n" >> /tmp/${xendomu}/etc/network/interfaces
printf "done.\n"

printf "Setting up apt sources: "
echo "deb http://archive.ubuntu.com/ubuntu gutsy main universe" > /tmp/${xendomu}/etc/apt/sources.list
printf "done.\n"

printf "Updating apt: "
chroot /tmp/${xendomu} apt-get update
printf "done.\n"

printf "Disabling threads: "
mv /tmp/${xendomu}/lib/tls /tmp/${xendomu}/lib/tls.disabled
printf "done.\n"

Daniel T Chen (crimsun) on 2008-10-22
Changed in xen-tools:
importance: Undecided → Low
status: New → Confirmed
Alvin Cura (alvinc) wrote :

I notice that this bug has not received any attention.

It should be noted that I have not seen this bug in jaunty or karmic, and do not recall if I saw it in hardy or intrepid.

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported should be reproducible with the live environment of the Desktop CD development release - Maverick Meerkat. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/. Thanks again and we appreciate your help.

Axel Beckert (xtaran) wrote :

This issue (no console for DomU, just ssh) was likely caused by the move of Xen towards using hvc0 as console which has been fixed in xen-tools 4.2~beta1-1 from May 2010. I'm hence closing this issue as "Fix Released" in xen-tools.

Changed in xen-tools (Ubuntu):
status: Confirmed → Fix Released

Can you still reproduce this bug? Thank you for telling us!

affects: xen-3.1 (Ubuntu) → xen (Ubuntu)
Changed in xen (Ubuntu):
status: New → Incomplete

On Sat, Nov 10, 2012 at 10:51 AM, Thomas Hotz <email address hidden> wrote:
> Can you still reproduce this bug? Thank you for telling us!

I haven't played with xen+ubuntu for a while. I sincerely don't know
if this bug is still there.

Perhaps someone else can confirm if this bug is still present - leaving as Incomple for now.

Changed in xen (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers