Welcome to the Linux Foundation Forum!

virt-install becoming a headache

hi all!!

i want to try virtualization with kvm. i have a server that supports V-Tecnology. i installed all necessary packets so virt-install can work. i have a centOS 5.5 with no graphical interface with kernel 2.6.18-194(default kernel of this distro) , static ip. i have been looking lots of how-to's it seems very simple to do it, but i don't get well along with it, and i'm becoming a little bit feed up of it so i'm writting here.

the kvm % kvm-intel modules load fine.

FIRST QUESTION: in lots of how-to's tells that you need a version 2.6.20 or higher of kernel to have kvm support, but at the kvm-how-to page it tells that it wil work with version 2.6.17 or higher. i supose that if you don't have a friendly kernel kvm it will not work. am i right?

i want to create 3 VM, 2 centos5.2 of 64 & 32 bits, and one fedora of 32b for the coorp i work., each of them in text mode.

with this command:

virt-install -n BXVI \

-r 1024\

--vcpus=1\

--os-type linux\

--accelerate\

--nographics\

-v\

-l /data/dist_img/Centos_5.2_final.iso\ / * if i put instead -cdrom instead of -l it happens the same

--disk patj=/data/images/disk.img

-x "console=ttyS0"

before configuring networks and other things i want to create 1 VM and then i will think of adding network & other stuff.

so once i press enter after putting the command above. it starts the installation of the CentOS in text mode.

first appears the menu to select the language ---> no problem

second appears the menu called "Installation Method" with 5 options "Local CDRom, Hard Drive, NFS image, FTP, HTTP" and i get stuck here

because if i select the option of "Local CDrom" or "Hard drive" it tells me that for the first "it doesn't find the CentOS CD" and for the second tells me that "it seems that i don't have any hard drives on my system", and it asks me if i want to configure an additional device but if i put yes it prints an error telling that it failed to mount driver disk or saying that driver disk is invalid for this release of centos.

if i select http it tells me to configure ipv4 telling if it will be dhcp or manual config. but with this option i supose that i had to add the option of "--network Bridge:default" even with it it does nothing, well if i configure it manually it ask me an IP, Mask, Gateway, DNS. then i put the mirror direction and the path to the centos and it prints me an error

2 QUESTION: why the h__ it shows the second menu of "Installation Method" if i put where was the iso, the virtual disk to install the OS guest...¬ø?¬ø?¬ø

i don't now how to get to the next step of the installation can somebody please help me!!

thanks!!

Comments

  • dwclarke
    dwclarke Posts: 12
    I'm not sure if this is related, but could possibly be. I've been unable to install CentOS5.5 or 5.6 into VMWare, with similar error messages of being unable to find the CD.

    Maybe try your Fedora installation, first, and see if that goes smoother.
  • atreyu
    atreyu Posts: 216
    I'm a command-line weenie myself, but in this case, I have to ask: why don't you try the graphical interface for creating virt systems?

    In Fedora at least, you can run
    virt-manager
    
    which belongs to an RPM package of the same name. It launches an app wizard that helps you through all the steps. I'm not saying it'll work better, but maybe it will help you. I haven't done it on CentOS (to my recollection anyway), but I see that the virt-manager package is available for it.

    -bill
  • wikisb
    wikisb Posts: 12
    hi atreyu ,dwclarke & all others!!
    its not a thing that i like trying it without GUI but i'm told to do it in text based. the boss rules ;(.
    now i will try installing Fedora but i'm not shure that is going to work
    i also tried to crearte a br0(bridge). the ip of my server is static is 172.20.1.16 and i'm not shure if putting in the virt-install command --network bridge:br0 will give a network interface to my VM. i followed what was written here(the static part) :
    http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaai/kvminstall/liaaikvminstallbridge.htm

    that made my host couldn't connect to internet
    and then i entered this command:
    virt-install -n BXVI\
    -r 1024\
    --accelerate\
    --nographics\
    -l http://mirrors.manchester.icecolo.com/centos/5.5/os/x86_64/
    -network bridge:br0\
    -f /data/images/disk.img
    then i could see how it was downloading the necessary files to start the installation. after this it prompted the language menu. the next menu shown is the "Configuration TCP/IP" it shows the ipv4 & ipv6 with the options of automatically configure (dhcp) o manual. i disabled ipv6 because im not using it and did the manual conf of ipv4 i tried diferent ip's but i didn't get nothing.
    is a bit wierd that if you attach a network interface to you guest then it shows the configuration TCP/IP when actually the br0 tells the VM how to connect or i'm mistaken¬ø?¬ø?¬ø?¬ø
    if something is obvious i'm sorry but i'm a noob
    i'm quite lost!!!
  • atreyu
    atreyu Posts: 216
    okay, i understand. on my CentOS box (ver 5.2) i first made sure i had the following packages installed:

    python-virtinst
    xen
    qemu
    libvirt


    then I did:
    service libvirtd start
    

    then, to create a test image, i did:
    virt-install \
      --os-type=linux \
      -c /data/iso/Fedora-10-i386-DVD.iso \
      -f /data/F10-virt-OS \
      -d
    

    it asked me a couple questions (about file size, graphics, etc.) then launched the standard Fedora 10 boot menu you see when installing from the DVD.

    in my virt-install command, i did not include a lot of your other parameters, b/c i just wanted to see if i could get an install to start.
  • wikisb
    wikisb Posts: 12
    hi again atreyu
    i did what you posted but i had to add a couple of things like the name of the guest & -file (wich i created with qemu-kvm of type qcow2).
    the -d (debug) went fine without any errors
    with the large command it showed me:
    Starting install ....
    Retrieving file .treeinfo....
    Rretrieving file vmlinuz....
    Retrieving initrd.im ....
    creating domain
    connected to domain BXVI
    and then it enteres the text based installation but i get stuck in a part where i commented in the first post

    with the command you put it only prints
    Lots of debuging stuff
    xml file
    Creating domain...
    2 debug lines
    a big piece of XML
    connected to domain BXVI
    Escape character is ^]
    it gets stuck here
    it doesn't appear a text based installation as with the large command i tiped before. even if i add -x "console=ttyS0"

    i have all those paquets installed and libvirtd appears to work fine
    thanks for your response but i'm not getting further
    any other idea¬ø?¬ø?
  • atreyu
    atreyu Posts: 216
    i was able to replicate your problem on my CentOS box by calling virt-install with the ISO being named using '-l' like you said you did:

    -l /data/iso/Fedora-10-i386-DVD.iso

    but if i call it with '-c', then it works (for me):

    -c /data/iso/Fedora-10-i386-DVD.iso

    does that make a difference?
  • wikisb
    wikisb Posts: 12
    hi atreyu
    thanks once again to post.
    i have tried with "-c" or "--cdrom" but it just gets stuck at "connected to domain" "Escape character is ^]" i don't know what the heck is going on.
    at least with -l or --location it showed the menu installation but as before i don't know when it reaches the part of chossing the "Installation Method" i'm quite lost ;(
    what do you guess its going on with my server o whatever so you could execute with -c or --cdrom and i get stuck if i use them.
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    hi atreyu
    thanks once again to post.
    i have tried with "-c" or "--cdrom" but it just gets stuck at "connected to domain" "Escape character is ^]" i don't know what the heck is going on.
    at least with -l or --location it showed the menu installation but as before i don't know when it reaches the part of chossing the "Installation Method" i'm quite lost ;(
    what do you guess its going on with my server o whatever so you could execute with -c or --cdrom and i get stuck if i use them.
    It sounds like the install is started, you just can't see the actual install screen. I know you are *supposed* to do this text-only, but can you leave off the --nographics option, and add the --vnc option and see if that gets you any further?
  • wikisb
    wikisb Posts: 12
    hi again atreyu it seems that you are the only who is helping here
    sorry for posting things a bit late. i'm becoming feed up of it, im becoming frustated
    i have tried what you said trying with "--vnc"
    as i haven't got SDL libraries neither others of graphical things it prompted this :
    "(virt-viewer:9095) Gtk-WARNING **: cannot open display: Domain installation still in progress. You can reconnect to the console to complete the installation process" (the normal thing should be "running server 127.0.0.1 port 5900"???)
    i supose that i will have to connect with my server with putty or a similar program. my server si called "fsystem" and has a static ip as i havent put a specific port to vnc the port where is working vnc its 5900.
    so i have put in putty the static ip of my server and the port 5900 but it doesn't connect.
    with virsh list --all i get the VM running but i can't acces to it to install the OS guest.

    also i wanted to try with an xml. i pasted a xml file from one of my VM that i couldn't install(i did destroy & undefine of that VM) and changed some things so it showed the device /dev/cdrom or exactly the path of the iso. i did virsh create or define name.xml but i can't acces to it to begin the installation. if i do virsh list --all i see the VM of the xml running but nothing else

    i have done virsh console nameVM and it connects to domain but it only prints Espace character is ^] and it doesn't do nothing else.
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    hi again atreyu it seems that you are the only who is helping here
    sorry for posting things a bit late. i'm becoming feed up of it, im becoming frustated
    i have tried what you said trying with "--vnc"
    as i haven't got SDL libraries neither others of graphical things it prompted this :
    "(virt-viewer:9095) Gtk-WARNING **: cannot open display: Domain installation still in progress. You can reconnect to the console to complete the installation process" (the normal thing should be "running server 127.0.0.1 port 5900"???)
    i supose that i will have to connect with my server with putty or a similar program. my server si called "fsystem" and has a static ip as i havent put a specific port to vnc the port where is working vnc its 5900.
    so i have put in putty the static ip of my server and the port 5900 but it doesn't connect.
    with virsh list --all i get the VM running but i can't acces to it to install the OS guest.

    also i wanted to try with an xml. i pasted a xml file from one of my VM that i couldn't install(i did destroy & undefine of that VM) and changed some things so it showed the device /dev/cdrom or exactly the path of the iso. i did virsh create or define name.xml but i can't acces to it to begin the installation. if i do virsh list --all i see the VM of the xml running but nothing else

    i have done virsh console nameVM and it connects to domain but it only prints Espace character is ^] and it doesn't do nothing else.
    I missed the part in your orig. post about you running without a graphical environment. i'll try that myself when I get to work and see if I can replicate this problem. if anyone else has a clue - jump in!
  • mfillpot
    mfillpot Posts: 2,177
    I am sorry that I have been offline and haven't been able to help, I have been working on system upgrades. It is good to see that you have gotten some of your issues resolved.

    It sounds like your no-hui option is blocking the GUI based installers from completing, removing the no-gui option as atreyu stated for the basic installation and adding it for future boots sounds like the best option for your problems.

    I will jump into your problem this evening following all of your posts and will reply with the exact steps I have taken and any solutions I may find.
  • atreyu
    atreyu Posts: 216
    How about this - can you SSH into your CentOS server (which has no GUI) from another Linux machine that does have a GUI? If so, then make sure the virt-viewer package is installed on your CentOS server then try the following. I just tried this on a Fedora 10 server with no GUI (just the core OS plus the required KVM packages and dependencies) and it worked for me:

    1. Log into a Gnome desktop on my Linux workstation
    2. SSH to my Fedora 10 server, being sure to enable X11 forwarding ( e.g., ssh -Y <SERVER_IPADDRESS> )
    3. start the virt-install command like so:
    virt-install \
     --os-type=linux \
     -c /data/iso/Fedora-10-i386-DVD.iso \
     -f /data/F10-virt-OS \
     -d \
     -nF10test \
     -r256 \
     --vcpus=1 \
     -s1 \
     --bridge=virbr0 \
     --accelerate \
     --vnc
    

    After a bunch of output is spewed to the terminal, a graphical window pops up which has the Fedora install running in it.

    If you do not have the ability to SSH into your server from another Linux workstation, let us know and we'll keep digging...
  • wikisb
    wikisb Posts: 12
    hi atreyu
    i have done what you said despite using --vnc instead of using text mode just to try if finally works a VM on my server.
    entering the command it printed a warning
    Gtk-WARNING **: cannot open display"
    i googled and i found something about xhost+localhost but it doesn,t solve nothing
  • wikisb
    wikisb Posts: 12
    also can someone tell me why during the installation in text mode, after the menu of language selection, the menu "Installation Method" i can't do nothing. i've tried all the options but it doesn't work nothing.
    i have seen that in graphical mode the menu "Installation Method" you can put rutes(rute in HD where is Iso, o where is cdrom, among other things) thing that you can't do in text mode
    thanks!!
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    hi atreyu
    i have done what you said despite using --vnc instead of using text mode just to try if finally works a VM on my server.
    entering the command it printed a warning
    Gtk-WARNING **: cannot open display"
    i googled and i found something about xhost+localhost but it doesn,t solve nothing

    Did you do steps 1) and 2) first? In other words, are you sitting at a Linux PC and logged into a graphical desktop (looks kinda like Windows, Gnome/KDE are likely what you'd be using), opening a terminal (xterm, konsole, gnome-terminal, etc.), then connecting to your CentOS server via SSH, using the '-Y' flag?

    I haven't had to use the xhost command in some time, but if you do use it, it should be run on the machine that is hosting the graphical environment, not the CentOS server, and should be run by the user logged into the desktop. You can run it like:
    xhost +
    

    Once you've SSH'd into the CentOS server, check the DISPLAY environmental variable like this:
    echo $DISPLAY
    
    It should not be empty, and might say something like localhost:10.0

    Before running virt-install again, you can test that your DISPLAY is properly getting set by running any graphical program that is installed on your CentOS server (firefox, nedit, xeyes, glxgears, etc.) by just running it - it should just appear on your desktop as if you had launched it locally (from the Linux workstation).
  • wikisb
    wikisb Posts: 12
    i followed the steps in your previous post. i used a linux VM with GUI on a windows host (not my election, where i work all pcs have win). i did echo $DISPLAY and it printed an empty line.
    i haven't run any graphical program because my server it has only what it needs to work without GUI. i haven't had a try because for each program with graphical interface there are lots of dependencies to install that i will not use
    i don't know if things change because i am using a linux guest.
    i'm wondering if maybe the problem that i have has something to do with the hardware of my server.
    thanks once again !!
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    i followed the steps in your previous post. i used a linux VM with GUI on a windows host (not my election, where i work all pcs have win). i did echo $DISPLAY and it printed an empty line.
    i haven't run any graphical program because my server it has only what it needs to work without GUI. i haven't had a try because for each program with graphical interface there are lots of dependencies to install that i will not use
    i don't know if things change because i am using a linux guest.
    i'm wondering if maybe the problem that i have has something to do with the hardware of my server.
    thanks once again !!
    So you're in a Linux VM on a Windows PC, trying to create a VM on another PC? I'm not sure how that whole X mess is sorted out there, but can you install apps on the Windows PC? If so, try Xming - it is a free port of the X server for the Windows platform, and is great for people such as yourself, who are forced to use Windows at work.

    http://sourceforge.net/projects/xming/

    If you can, please try it out, instead of using the Linux VM. It should have SSH included with it, so you can start your X server and then, I think, you'd run putty, to connect to your CentOS server.

    If you can't install stuff, or don't want to try that, let us know...
  • wikisb
    wikisb Posts: 12
    hi atreyu
    now i will try xming and try what you told me.
    also i wrote to libvirt team and they told me this:

    "Using --location with a CDROM doesn't really work all that well. The easiest
    thing to do is mount that ISO somewhere and export the directory over HTTP,
    then use --location http://localhost/path/to/the/mounted/iso and it should all
    work"

    but i don't know how to export the mounted iso over HTTP i have searched a bit but...i have seen a side for client and another for server, but i guess that maybe there is a way to export it at server(my host) and with virt-install(the same host) puting -l http://localhost/PATH/to/mounted/ISO. or i am saying a stupid thing¬ø?
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    hi atreyu
    now i will try xming and try what you told me.
    also i wrote to libvirt team and they told me this:

    "Using --location with a CDROM doesn't really work all that well. The easiest
    thing to do is mount that ISO somewhere and export the directory over HTTP,
    then use --location http://localhost/path/to/the/mounted/iso and it should all
    work"

    but i don't know how to export the mounted iso over HTTP i have searched a bit but...i have seen a side for client and another for server, but i guess that maybe there is a way to export it at server(my host) and with virt-install(the same host) puting -l http://localhost/PATH/to/mounted/ISO. or i am saying a stupid thing¬ø?

    Good idea contacting the libvirt team.

    Doing the exporting over HTTP thing is not too hard to do, but I don't think that is your problem. Let's tackle Xming first.

    But to get you prepped for the exporting thing, you'll need Apache running on the CentOS box - can you install it, or is it already installed? The package is called httpd. Check if installed with:
    rpm -qv httpd
    

    See if running with:
    service httpd status
    
  • wikisb
    wikisb Posts: 12
    yes you are right it is a bit of a mess having a linux VM conected via ssh to my server to create VM. but my first intention was to create all the VM manually in the server without any other pc's or VM
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    yes you are right it is a bit of a mess having a linux VM conected via ssh to my server to create VM. but my first intention was to create all the VM manually in the server without any other pc's or VM
    and you should absolutely be able to do just that from the command line on your server - i just don't know enough libvirt foo, as GoingEasy9 would say, but we'll get there...

    btw, that reminds me: if you had a kickstart file (they are popular with PXE/network installs) that was 100% correct and contained all the required parameters to enable the install to run completely automated - you wouldn't even need a console/window to walk thru the install. but that is for another day...
  • wikisb
    wikisb Posts: 12
    im with Xming
    im sorry but im a little bit dumb with it. it suposes to run the graphical interface of programs of remote pc's ? well i'm not getting it.
    i do XLaunch then i select option "multiple window"->start_client-> start_program=xterm(no options to chose) Run remote using putty ip of my server , user root & pasword empty clipboard enabled -> Additional parameters i have it empty-> Finish
    then apears a putty window to put the password i put it but then it seems that nothing happens although putty its running in background it seems.
    i don't know if i'm suposed to do this or what :s
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    im with Xming
    im sorry but im a little bit dumb with it. it suposes to run the graphical interface of programs of remote pc's ? well i'm not getting it.
    i do XLaunch then i select option "multiple window"->start_client-> start_program=xterm(no options to chose) Run remote using putty ip of my server , user root & pasword empty clipboard enabled -> Additional parameters i have it empty-> Finish
    then apears a putty window to put the password i put it but then it seems that nothing happens although putty its running in background it seems.
    i don't know if i'm suposed to do this or what :s
    sorry, guess you need to download putty separately. i thought it was bundled together, but i couldn't get it to work either.
    this worked for me - download putty from here:
    http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

    then:
    1. Run putty.exe
    2. In the pane on the left, click on Session,
    2. In the pane on the right, in the Host name field on the right, type your CentOS ip address
    3. In the pane on the left, under Connection, expand SSH and click on X11
    4. check the box marked Enable X11 forwarding
    5. Click Open button

    you may get a warning about keys or something, just click ok or whatever.

    you should get a black terminal window pop up, prompting you to log in. Log in as root w/root's password. Now echo $DISPLAY, you should get something back. Now try virt-install...

    make sure you have Xming started first, though - you should see the little black X icon in your system tray.
  • wikisb
    wikisb Posts: 12
    thanks alot for helping me atreyu

    i'm friendly with putty ;)
    i have done what you told me connect to my server with putty enabling X11 forwarding.
    doing echo $DISPLAY it print me a blank line.
    then doing virt-install again it happens the same thing as before when it enters "Installation Method" i can't do nothing.
    i have Xming in my system tray but it seems it does nothing. if i right click on it and enable root window it appears a full window white and black pixeled and nothing more
  • atreyu
    atreyu Posts: 216
    wikisb wrote:
    thanks alot for helping me atreyu

    i'm friendly with putty ;)
    i have done what you told me connect to my server with putty enabling X11 forwarding.
    doing echo $DISPLAY it print me a blank line.
    then doing virt-install again it happens the same thing as before when it enters "Installation Method" i can't do nothing.
    i have Xming in my system tray but it seems it does nothing. if i right click on it and enable root window it appears a full window white and black pixeled and nothing more
    Something else i forgot about - on the CentOS machine, check for X11Forwarding in this file:
    /etc/ssh/sshd_config
    It should be set to yes, but might default to no. If you do have to change it, restart the SSH daemon when you're done:
    service sshd restart
    

    If it is already enabled, it must be something else...

    EDIT: You might also need to make sure that the package xorg-x11-xauth is installed on your CentOS server.

    EDIT2: On your CentOS server, keep a tail running of your messages and secure logs, to give you any additional clues, e.g.:
    tail -f /var/log/messages
    tail -f /var/log/secure
    
  • marc
    marc Posts: 647
    And you must make sure your X server listens on TCP connetions
  • atreyu
    atreyu Posts: 216
    marc wrote:
    And you must make sure your X server listens on TCP connetions
    Marc,
    I thought the exact same thing, but I double-checked how X was launched on my Linux workstation and it was called with the -nolisten tcp flag, and yet it worked. Or is it some other setting?
  • fasthelp
    fasthelp Posts: 1
    Hi All,
    You may wish to try building out a logical volume in order to get virt-install working. This may solve your blank "black screen" issues.
    Cheers,
    PB
  • marc
    marc Posts: 647
    atreyu wrote:
    marc wrote:
    And you must make sure your X server listens on TCP connetions
    Marc,
    I thought the exact same thing, but I double-checked how X was launched on my Linux workstation and it was called with the -nolisten tcp flag, and yet it worked. Or is it some other setting?

    There probably is if you are using a session manager like KDM or GDM.

    In fact, this is one of the few things I do not like in KDE software: kdm launches X reading options from a different place from the defaults...

    Regards
  • yes you are right it is a bit of a mess having a linux VM conected via ssh to my server to create VM. but my first intention was to create all the VM manually in the server without any other pc's or VM
    The Synapses

Categories

Upcoming Training