I'm having problems trying to install CentOS as a KVM guest despite following the wikis and howtos. The problem is that most of the instructions skip the part that happens after virt-install... It seems that something blindingly obvious happens if nothing goes wrong and most instructions continues from the OS installation screen. However, when I try this, I get a blank console that says "Escape Char is ^]" and doesn't do anything useful. If I specify --vnc options, the blank console doesn't appear but the CentOS guest doesn't respond to VNC connections. I've tried connecting on the public IP, on the LAN IP, on loopback 127.0.0.1, with autoport, with different specified ports, port numbers - 5900 since vnc seems to accept :1 as 5901, enabling qemu to listen on all public interfaces and allowing exceptions in iptables just in case loopback 127.0.0.1 is blocked. But nothing gives me a console/screen that I can install the OS. Or should I expect VNC to work, given that the OS isn't installed, or is it an inbuilt function of KVM? The VM guest appears to be loaded, there are no obvious errors, virsh list shows the VM but I can't do anything with them. It's been really frustrating. Can anybody please point out what's the obvious step or magic trick I'm missing?
On Tue, 26 Apr 2011, Emmanuel Noobadmin wrote:> I'm having problems trying to install CentOS as a KVM guest despite > following the wikis and howtos. > > The problem is that most of the instructions skip the part that > happens after virt-install... It seems that something blindingly > obvious happens if nothing goes wrong and most instructions > continues from the OS installation screen. > > However, when I try this, I get a blank console that says "Escape > Char is ^]" and doesn't do anything useful.I've only done text-based installations of CentOS under KVM, so I can't comment on VNC options. Here's an edited form of a standard virt-install script: virt-install \ --name="VMName" --ram="1024" --vcpus="1" \ --nographics --accelerate \ --os-type="linux" --os-variant="rhel5.4" \ --network="bridge:br0" --mac="54:52:00:12:34:56" \ --disk="path=/var/lib/libvirt/images/VMName.dsk,size=20" \ --location="http://some-mirror/centos/5/os/x86_64" \ --extra-args="console=ttyS0" As always, double-check to make sure that, e.g., the network option is configured appropriately for your environment. If you're doing a kickstart installation, the "ks=..." stuff goes within the extra-args option. -- Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/
On 26.4.2011 0.47, Emmanuel Noobadmin wrote:> I'm having problems trying to install CentOS as a KVM guest despite > following the wikis and howtos.I succeeded with this howto: http://sysadminman.net/blog/2011/kvm-virtualization-text-centos-guest-install-2098 Except I skipped the lvcreate part, as I don't use LVM. - Jussi
On 4/28/11, Gleb Natapov <gleb at redhat.com> wrote:> So why don't you use virt-manager?The original intention was to run the host without any graphical desktop or anything not necessary to host the guests. That was based on reading and such which recommends not having anything beyond the necessary to minimize potential security problems and maximize resources available. Then there were those pages which warn that virt-manager didn't work too well if bridged networking was required. Last but not least, when I finally gave up and installed the desktop, virt-manager couldn't find the hypervisor. Checking up, it appears that the user needed additional permissions to certain files, which after given and tested via CLI, I still get errors. Starting up X as root gave me this ominous warning that I really shouldn't be doing this and since I didn't think it was wise in the first place to have the desktop with root access running on what's supposed to be a production machine, I stopped trying that route and went back to figuring how to get virt-install to work.
On 4/28/11, Gleb Natapov <gleb at redhat.com> wrote:> Qemu is not intended to be used directly by end user. It is too complex as > you already found out. VMware don't even give you access to such low parts > of virt stack. You should use libvirt or virt-manager instead. Especially > if you are concerned about security. I think libvirt can start guest on > headless server.Sorry for the confusion, I was using libvirtd in CLI, i.e. virt-install and virsh, not qemu directly.> If this still fails for you you need to complain to libvirt developers > (not in a rant mode, but providing details of what exact version of > software you have problem with and what are you trying to do). And > libvirt developers will not be shy to complain to qemu developers if the > problem turned to be on their side.Apologies about the rant mode as well. Before that, I tried sending two emails (25th and 26th Apr) to the KVM list with some details, hoping to get some advice. But each of these failed to materialize on the kvm list for unknown reasons. So I resorted to posting to the CentOS list, where I did get some response for which I'm very thankful. The rant post came when despite the additional advice which helped me get a little further, I keep running into unexpected brickwalls like anaconda not seeing the "dvd" (mounted ISO specified using --location) that it just booted from. Out of frustration, I CC'd that particular email to the kvm list, figuring that since it's likely to get me flamed, the imp of perversity would probably let it through... and it did.> As far as I know libvirt has no problem using bridged networking and > virt-manager use libvirt so it should work if you use new enough virt > stack, but you should ask on libvirt mailing list instead.I guess those were outdated warnings on older versions. I'll give it another spin given some of the new suggestions like using virt-install to create the disk file. If it still doesn't work, I'll go check the libvirt ML (I'm belatedly getting the idea that libvirt is not part of kvm).
On 4/28/11, Gleb Natapov <gleb at redhat.com> wrote:> of virt stack. You should use libvirt or virt-manager instead. Especially > if you are concerned about security. I think libvirt can start guest on > headless server. > > If this still fails for you you need to complain to libvirt developers > (not in a rant mode, but providing details of what exact version of > software you have problem with and what are you trying to do). And > libvirt developers will not be shy to complain to qemu developers if the > problem turned to be on their side.I've finally got an installation working, not using virt-install or virt-manager. After reading through the libvirt site, I started writing the domain definition manually. Through trial and error, comparison with what virt-install generated and the online examples, I got a working xml. Just for the record, virsh --version reports 0.8.1 For the benefits of other newbies, my discovery so far is that 1. No-activity after the guest VM started Originally, when I specified the CentOS DVD ISO, the guest will load and then do nothing but chew up 100% CPU cycle on the allocated 1 vcpu for quite some time. Subsequently, it appeared that mounting the ISO as loop back is the solution. This seemed to imply that libvirt or KVM couldn't boot a guest from ISO... which didn't quite make sense. I ran into the issue when using my manually generated XML, it turned out that the reason was the permissions (644) on vmlinuz and initrd.img on the DVD. By copying the two files to local disk, changing the permissions and using the <initrd> and <kernel> options, I was able to boot the guest. I was curious how virt-install got around this and learnt that I could dump the config from a running machine. It turns out that virt-install didn't exactly use the .xml it created, it added stuff to the running version. Importantly making a temporary copy of initrd.img and vmlinuz. I think the ISO problem with virt-install may be that it was unable to mount the ISO to copy these files despite me running it as root. 2. Anaconda couldn't see the DVD Which was my rant earlier, since it sounded really stupid that the installer couldn't see the disc it just booted off. Now, with #1 solved, it seems that anaconda wasn't booting off the disc after all. However, the interesting thing here is that once I got past #1, My guest could install from the DVD. After comparing the xml files, it seems the problem is virt-install did not save the path to the ISO/mounted DVD. Under the <disk> element, there wasn't a source. With my manually generated xml, specifying the ISO as the source worked. But the virt-installed anaconda was complaining I don't have any hard disks or cdroms. Not that there was no disk in the drive. Everytime I picked an option like install media in HDD or CDROM, it prompted me no device, do I want to install a driver. Since the hard disk definition appears to be the same, I'm not sure why that happened with virt-install's xml but not mine. So right now, I managed to get the OS installed, rebooting it required removing the initrd and kernel entry as well as the source so that it would boot from the image disk. Only problem is... networking still isn't working although brctl show on the host shows that a vnet0 had been created and attached to the bridge. Any pointers would be appreciated!
Apparently Analagous Threads
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?
- Standardizing an MSR or other hypercall to get an RNG seed?