0

I have been installing ubuntu in VMs (using KVM) for development for quite some time now and I have been facing a problem where the boot loader never seemed to install and just fail.

So, either I would install the boot loader manually or just manually partition the disk while installing.

What's the best fix for a smoother install?

closed as unclear what you're asking by Rui F Ribeiro, Jeff Schaller, schily, thrig, Stephen Harris Jun 25 '18 at 0:57

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

0

I use virt-manager (or GNOME Boxes) instead of directly using the kvm / qemu -kvm command. You will hopefully find that 1) the creation wizard attempts to autodetect the distribution & version of the install media; 2) if it fails to auto-detect, you will be offered a list which includes recent versions of Ubuntu. (I.e., if your Ubuntu version is too new to be listed in your virt-manager, you can usually just select the most recent Ubuntu version from the list. But see NOTE below in any case).

The implication is that virt-manager chooses an efficient "hardware" configuration, which meets the hardware requirements of Ubuntu, and provides the most efficient virtual hardware that Ubuntu is able to use.

NOTE. virt-manager also offers an option to expand this configuration, i.e. customize the hardware config before starting the install. Personally, I make sure to do this and and double-check the RAM size against the Ubuntu installation documents. I had to increase RAM size at one point to avoid the VM grinding to a halt somewhere during the install, I think this was with Ubuntu 18.04 but I might be mis-remembering.

I have successfully installed Ubuntu Desktop 16.04 and 18.04[*] from their respective live cds, using this method. (I think they do not default to LVM, but I tend to avoid enabling LVM inside VMs. Some of the uses of LVM may be met by instead creating and resizing separate virtual disks).

(If either Ubuntu enabled LVM by default for you, or you have a specific reason for wanting LVM services inside a VM, perhaps you could edit your question to be more specific).

[*] um. actually I forgot, something did go wrong with installing Ubuntu Destop 18.04 from the live cd, running inside virt-manager on Fedora Linux 28. The installer GUI stopped updating, and I think there was a kernel hung task message about QXL. Changing the type of virtual graphics hardware avoided this, I think I used Cirrus. It might be possible to change the graphics hardware back after finishing the install and applying all software updates including the kernel.

  • I do use virt-manager but I guess I kinda reused boxes which I used for CentOS or something else. That is probably why I got that error. I just tried a new VM from scratch and it worked! And about LVM, I guess I just went with it by habit. Like in the other answer, I just use separate disks for data anyways, so there is no benefit of LVM here then. Thanks! – Pramodh Valavala Jun 24 '18 at 12:03
  • @PramodhValavala unlucky :). I did wonder if you were passing a disk image with some pre-created partition table. Btw I have updated this answer because I just remembered I did have a specific problem with 18.04, so I don't want to give a misleading impression about that :). I don't remember having the same problem with 16.04. – sourcejedi Jun 24 '18 at 12:49
0

I have finally found a solution to this problem of mine.

The virtual drives were using msdos partition tables which was causing problems if I let the ubuntu installer set up the LVM partitions for me.

But when I changed the partition table to gpt (using gparted), the install went through fine.

  • something is not well explained here, people have been using LVM for ages with both setups. – Rui F Ribeiro Jun 24 '18 at 10:50
  • I guess the problem is not exactly pertaining to lvm but how the Ubuntu installer sets things up. I have come across many questions similar to this but never found a solution to it until now and wanted to share this. – Pramodh Valavala Jun 24 '18 at 10:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.