Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo as QEMU/KVM guest
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
leonchik1976
Apprentice
Apprentice


Joined: 24 Jan 2010
Posts: 169

PostPosted: Wed Apr 26, 2017 10:25 am    Post subject: Gentoo as QEMU/KVM guest Reply with quote

I'm trying to install gentoo as QEMU/KVM guest, but can't get it boot anyway. No errors, no messages, just hangs.
I emerged grub2 with GRUB_PLATFORMS="qemu", and installed grub with grub-install --target=i386-qemu
Is there any changes for installing gentoo as qemu/kvm guest in handbook?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Wed Apr 26, 2017 9:09 pm    Post subject: Reply with quote

It works _exactly_ like a bare metal install as long as you go with default virtual hardware. (Qemu emulates common pieces by default. Performance of those is not very amusing, but it's well supported by OS and you can expect it to "just work"™). If you have dual boot on your hardware PC, you can even tell qemu to use the actual hard drive. You can boot windows into a VM this way too. Just make sure not to mount a single FS from host and guest at the same time, such scenario can easily damage that filesystem.
High performance virtio requires you to change some options in quest kernel.
Grub doesn't care either. At least grub 1 doesn't, no idea about grub2. Legacy works and is easy to use, so there is no reason to replace it.
Make sure your guest has enough RAM. Default used to be pretty low.


Bonus: qemu does support direct boot for linux. You still need an image of filesystem, but you supply your kernel and optional initramfs as separate files ( -kernel -initrd and -append params on qemu command line).
Back to top
View user's profile Send private message
leonchik1976
Apprentice
Apprentice


Joined: 24 Jan 2010
Posts: 169

PostPosted: Thu Apr 27, 2017 4:31 am    Post subject: Reply with quote

I think i figured out what was my problem. Initially i built grub only with GRUB_PLATFORMS="qemu", and tried grub-install --target=i386-qemu, but it didn't worked, so i boot up with systemrescue cd, installed grub, and what it gave to me is: "Installing for i386-pc platform" and it's booted!
So i believe i should rebuild grub with "PC" grub_platform?
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4734
Location: Angra do Heroísmo (PT)

PostPosted: Thu Apr 27, 2017 7:41 pm    Post subject: Reply with quote

leonchik1976 wrote:
I think i figured out what was my problem. Initially i built grub only with GRUB_PLATFORMS="qemu", and tried grub-install --target=i386-qemu, but it didn't worked, so i boot up with systemrescue cd, installed grub, and what it gave to me is: "Installing for i386-pc platform" and it's booted!
So i believe i should rebuild grub with "PC" grub_platform?


Yes, you want to use the PC platform with QEMU.
_________________
Jorge.

Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum