Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd March 2010, 19:36
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default kvm install guest without gui?

I'm running Debian Squeeze and kvm/qemu which installed successfully. Is there any equivalent to the way xen did it, where it bootstraps in and you just console in and set the rest up, or do you have to build vnc somehow to finish the guest install? I don't want a gui on either host or guest.

I have tried to start a new vm using:
Code:
virt-install --connect qemu:///system -n vm11 -r 1024 --vcpus=8 -f /home/vm/vm11.qcow3 -s 100 -c /some/path/debian/debian-testing-amd64-CD-1.iso -vnc :1 --noautoconsole --os-type linux --os-variant debianSqueeze --accelerate --network=bridge:br0 --hvm
which was successful, then try to connect to it with
Code:
vncviewer :1 
or
vncviewer my.lo.cal.ip:1
but I get
Code:
Error: can't open display
I have also tried connecting to it with a Debian server running a gui on the same subnet using vnc, but it won't connect. Then I tried to use virt-install with the -serial switch, but that just errored out and wouldn't build the machine

Last edited by unclecameron; 3rd March 2010 at 20:25.
Reply With Quote
Sponsored Links
  #2  
Old 4th March 2010, 19:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Ubuntu has the vmbuilder tool which does it, but I don't know if it's available for Squeeze as well.
Otherwise, you must use VNC, but you don't need to install a desktop on the host or guest. You jsut need some desktop system with a VNC client.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 4th March 2010, 20:50
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default

vmbuilder is available for Etch, but still waiting to be ported to Squeeze, it errors out when I attempt to run it.

on a Debian machine with a gui and vnc on the same subnet trying to connect to ip.of.kvm.box:1 I get a connection refused, though I can vnc/rdp using this same client to several other boxes on the subnet, do I need to install any other app on the KVM box? The KVM box doesn't have a gui.

If I can't get this to work, can I do the same thing in virtualbox, and is virtualbox performance similar to KVM? Most of the time I don't use gui's at all, that's a real disadvantage for server admin, which is why I used xen until it got pulled from the kernel in Squeeze
Reply With Quote
  #4  
Old 5th March 2010, 15:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Quote:
Originally Posted by unclecameron View Post
on a Debian machine with a gui and vnc on the same subnet trying to connect to ip.of.kvm.box:1 I get a connection refused, though I can vnc/rdp using this same client to several other boxes on the subnet, do I need to install any other app on the KVM box? The KVM box doesn't have a gui.
Is there a firewall on the host? What's the output of
Code:
iptables -L
?

Quote:
Originally Posted by unclecameron View Post
If I can't get this to work, can I do the same thing in virtualbox, and is virtualbox performance similar to KVM? Most of the time I don't use gui's at all, that's a real disadvantage for server admin, which is why I used xen until it got pulled from the kernel in Squeeze
Yes, you can do this with vBoxheadless (see the tutorials on this site), but you still need a remote desktop connection. I can't say much about the performance, but I guess KVM should be more performant since it's an official part of the kernel.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 5th March 2010, 19:53
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default

Since VirtualBox still needs a vnc server, I decided to just work on KVM again, in the meantime I got vncviewer to run a remote box after installing (on server)
Code:
apt-get install tightvncserver xtightvncviewer
vncserver :2 -geometry 1024x768 -depth 16 -pixelformat rgb565
now, after attempting to kill all kvm vm's from the original attempt (before trying VirtualBox) and then trying to install a new one with my :2 display selected, like this:
Code:
virt-install --connect qemu:///system -n sq1 -r 1024 --vcpus=8 \
 -f /home/vm/sq1.qcow5 -s 50 \
 -c /path/to/debian-testing-amd64-CD-1.iso \
 -vnc :2 --noautoconsole --os-type linux --os-variant debianSqueeze \
 --accelerate --network=bridge:br0 --hvm
I get
Code:
ERROR    Guest name 'c' is already in use.
Why do I get this, I'm not specifying guest 'c'? When I enter virsh and run
Code:
virsh # list --all
 Id Name                 State
----------------------------------
  - c                    shut off
  - vm10                 shut off
virsh # destroy c
error: Failed to destroy domain c
error: Requested operation is not valid: domain is not running
virsh # domstate c
shut off
virsh # dominfo c
Id:             -
Name:           c
UUID:           b341252f-46f2-ff62-ef38-71ef2d441cf0
OS Type:        hvm
State:          shut off
CPU(s):         8
Max memory:     1048576 kB
Used memory:    1048576 kB
Autostart:      disable
Security model: qemuDAC
Security DOI:
how do I remove that guest and why can't I create a new one with the above virt-install command? I tried to start 'c' vm and then looked at it, here's what I have:
Code:
ps aux | grep virt
root      1932  0.0  0.0 245148  8452 ?        Sl   08:33   0:00 /usr/sbin/libvirtd -d
106       2449  0.1  0.0 1732084 11884 ?       S    09:27   0:02 /usr/bin/qemu-system-x86_64 -S -M pc-0.11 -m 1024 -smp 8 -name c -uuid b341252f-46f2-ff62-ef38-71ef2d441cf0 -nographic -monitor unix:/var/lib/libvirt/qemu/c.monitor,server,nowait -boot c -drive file=/home/vm/vm11.qcow3,if=ide,bus=0,unit=0,format=raw -drive if=ide,media=cdrom,bus=1,unit=0 -net nic,macaddr=52:54:00:37:4f:e1,vlan=0,name=net0 -net tap,fd=46,vlan=0,name=hostnet0 -serial pty -parallel none -usb -usbdevice tablet -vga none -balloon virtio
but it's not connected to a display so I can't view it on a remote machine, and even if I
Code:
kill 2449
I still get the same error when trying to create a new hostname. I think the install is hung, I just can't figure out how to unhang it
Reply With Quote
  #6  
Old 5th March 2010, 23:55
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default

I have also tried to
Code:
virsh
unregister c
but it said there's no such domain, then I updated my switches to virt-install man page for squeeze, so it looks like:
Code:
virt-install --connect qemu:///system -n sq1 -r 1024 --vcpus=8 \
--file=/home/vm/sq1.qcow5 size=50 \
--location=http://ftp.us.debian.org/debian/dists/squeeze/main/installer-amd64/ \
-vnc :2 --noautoconsole --os-type=linux --os-variant=debiansqueeze \
--accelerate --network=bridge:br0 --hvm
but I get the same error:
Code:
ERROR    Guest name 'c' is already in use.
I have also tried using
Code:
virt-install --prompt
to do it interactively, but that script errors out with
Code:
ERROR    this function is not supported by the hypervisor: virConnectNumOfDefinedStoragePools
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 972, in <module>
    main()
  File "/usr/bin/virt-install", line 762, in main
    options.sparse, options.nodisks, guest, conn)
  File "/usr/bin/virt-install", line 314, in get_disks
    get_disk(disk, size, sparse, guest, conn, is_file_path)
  File "/usr/bin/virt-install", line 280, in get_disk
    d = cli.disk_prompt(None, kwargs)
  File "/usr/lib/pymodules/python2.5/virtinst/cli.py", line 427, in disk_prompt
    dev = VirtualDisk(**arg_dict)
  File "/usr/lib/pymodules/python2.5/virtinst/VirtualDisk.py", line 372, in __init__
    self.__validate_params()
  File "/usr/lib/pymodules/python2.5/virtinst/VirtualDisk.py", line 863, in __validate_params
    self.__check_if_path_managed()
  File "/usr/lib/pymodules/python2.5/virtinst/VirtualDisk.py", line 733, in __check_if_path_managed
    os.path.dirname(self.path))
  File "/usr/lib/pymodules/python2.5/virtinst/util.py", line 553, in lookup_pool_by_path
    inactive_list = conn.listDefinedStoragePools()
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 1583, in listDefinedStoragePools
    if ret is None: raise libvirtError ('virConnectListDefinedStoragePools() failed', conn=self)
libvirtError: this function is not supported by the hypervisor: virConnectNumOfDefinedStoragePools
after I specify filesystem type. Racking my brains out
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM Guest - Networking problem satimis Server Operation 2 8th May 2010 16:13
Install failure -- Apache 1.3 missing? Allen15 Installation/Configuration 11 24th February 2009 10:53
How to install OpenOficeOrg 3.0.0 in Ubuntu 8.04 ernesthagger HOWTO-Related Questions 43 23rd December 2008 15:42
ISPConfig install issues... flyingaggie Installation/Configuration 2 18th July 2008 11:46
Help With GUI Menu nightfire Programming/Scripts 3 1st July 2008 16:27


All times are GMT +2. The time now is 02:59.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.