
3rd March 2010, 18:36
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
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 19:25.
|

4th March 2010, 18:33
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,591 Times in 2,443 Posts
|
|
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.
|

4th March 2010, 19:50
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
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
|

5th March 2010, 14:10
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,591 Times in 2,443 Posts
|
|
Quote:
Originally Posted by unclecameron
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 ?
Quote:
Originally Posted by unclecameron
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.
|

5th March 2010, 18:53
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
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
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
|

5th March 2010, 22:55
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
I have also tried to
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
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 08:08.
|
Recent comments
1 day 7 hours ago
1 day 10 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 15 hours ago
1 day 16 hours ago
1 day 17 hours ago
2 days 9 hours ago
2 days 10 hours ago
2 days 14 hours ago