Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on Virtualbox
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
moaxcp
n00b
n00b


Joined: 17 Dec 2014
Posts: 52
Location: Ashburn, VA USA

PostPosted: Sun May 17, 2015 2:29 am    Post subject: Gentoo on Virtualbox Reply with quote

Hello, I'm trying to install gentoo in virtual box and had a few questions about my setup.

On my laptop I have march=corei7-avx Would this cause any problems with a vm that only has 1 cpu?

What if I increase the cpus after gentoo is installed? Could this cause problems?

What is a good march that can be somewhat portable for other systems to use the vm?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Sun May 17, 2015 11:16 am    Post subject: Re: Gentoo on Virtualbox Reply with quote

moaxcp wrote:
Hello, I'm trying to install gentoo in virtual box and had a few questions about my setup.

On my laptop I have march=corei7-avx Would this cause any problems with a vm that only has 1 cpu?

No. Virtualbox allows the guest code to run natively on the host until it trues to do something directly to the hardware, then it steps in to emulate whatever that was.
Technically, Intel/AMD cpus allocate each instruction to one of four privilege levels, numbered 0 for most privileged to 3 for least privileged.
In practice, on the real hardware the kernel runs at level 0 and everything else at level 3. In the guest, the kernel runs at level 1 and everything else at level 3.
When the kernel, running at level 1, tries to execute a level 0 instruction, Virtualbox traps it and takes over. Then it gives control back to the guest.

Quote:
What if I increase the cpus after gentoo is installed? Could this cause problems?

No. This will be OK as long as you build your guest kernel with SMP support, so it can use the extra CPUs. I tend to install with 4 CPUs then after the hard work of the install is done, reduce the CPU and Memory. you need to restart the guest for the changes to take effect.

Quote:
What is a good march that can be somewhat portable for other systems to use the vm?

Set -mtune=generic and leave -march unset for the widest compatibility.
If you know the subset of CPUs you need to support you can run
Code:
gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
on each system to see what it supports.
You get all of the -mno- for free, so ignore them.

Fore every flag that all the CPUs have in common, set that in CFLAGS= in the guest.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
moaxcp
n00b
n00b


Joined: 17 Dec 2014
Posts: 52
Location: Ashburn, VA USA

PostPosted: Mon May 18, 2015 2:32 am    Post subject: Reply with quote

Thanks for the help. I decided to go with the generic option. I also used lvm so I can expand the hd in the future.
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