LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 09-13-2012, 11:02 AM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Rep: Reputation: Disabled
Where is my output going?


I'm creating a kickstart controlled VM using a command similar to this:

virt-install --connect=qemu:///system --initrd-inject=/tmp/ks.cfg --extra-args="ks=file:/ks.cfg console=tty0 console=ttyS0,115200" ...

where my kickstart script ks.cfg has a %pre script in it with the following:

%pre
clear >/dev/tty1
echo >/dev/tty1
echo -n "Hit ENTER to continue..." >/dev/tty1
read response

I know the read command executes because the installation pauses and I have to hit enter to have it continue. I don't see the text echoed to the console though. I've tried various things, including using chvt, but I can never get any of the messages generated in my %pre script to appear on my console when virt-install runs. What am I missing?
 
Old 09-13-2012, 11:44 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I've never done anything like that, but your install command sets the console to tty0, and your prompt seems to be to tty1. The read seems to not specify a tty at all, so it may be reading from tty0.
 
Old 09-13-2012, 12:08 PM   #3
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
Changing my pre-install script to redirect to /dev/tty0 doesn't have any effect--I still don't see the output of my pre script on the console. Is this even possible?
 
Old 09-14-2012, 12:18 AM   #4
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
What I mean is, is there a way to cause the output of the %pre and %post commands to appear on the console when you are doing a text only CentOS install via virt-install/kickstart?
 
Old 10-09-2012, 03:30 PM   #5
anon233
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
Switch to terminal during kickstart pre/post scripts

The following snippet should work for the post-install scripts section (and the pre-install section as well).

%post
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6

(The rest of your post-install stuff goes here)

Credit for this solution goes to Michael Ludvig.
 
Old 10-13-2012, 04:40 PM   #6
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
I tried added the lines

Code:
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6
to my %pre script but I still don't see anything on the console when my install runs. My virt-install command looks like

Code:
virt-install --connect=qemu:///system \
    --network bridge=br0 \
    --initrd-inject=/ks.cfg \
    --extra-args="ks=file:/ks.cfg text console=tty0 utf8 console=ttyS0,115200" \
    --name=vmtest \
    --disk path=/dev/sda1,bus=virtio \
    --vcpus=1 \
    --ram=2048 \
    --check-cpu \
    --accelerate \
    --hvm \
    --location=centos.iso \
    --nographics \
    --noreboot
Why does this trick with chvt not work for me?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Requests to my ISP server are output in the middle of output by any command I run. stf92 Slackware 2 07-10-2012 08:38 AM
[SOLVED] Bash; awk or sed output to variable: how keep newline at end of each output line porphyry5 Programming 3 06-10-2011 05:50 PM
Standard script output to screen & -x option output to file BoBeau236 Programming 6 05-10-2011 07:43 AM
ps -eH | grep java output in a active passive clustered output johnkalikavunkal Linux - Server 2 01-30-2009 11:21 PM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration