Is there a way to push all available resources to the program(VirtualBox) when running Ubuntu?
1 Answer
You can give a process more CPU time relational to other processes by re-nice-ing it. For example, run
pgrep VirtualBox
to get the PID
of VirtualBox. If more than one number pops up, you should run top
to see which one is using all the CPU - this is likely to be the one you want to fiddle with. The PID
is the first column.
Then you can do:
renice -5 PID
would give PID
a nice value of -5
. This gives it more CPU time than other processes competing for it.
"Niceness" ranges from -19 to 20; -19 is least-nice, meaning gets the most CPU time. 0 is the default. renice
must be run as root
, i.e., with sudo
, to change "niceness" to anything below 0
.
The changed niceness only lasts as long as the process runs; it will no longer be in effect after quitting VirtualBox, for next time you run it. (So you'll have to do it again each time.)
I don't think you can change the amount of RAM given to a VirtualBox guest at runtime. This would need to be done before booting it, in the virtual machine configuration.
-
-
1No, that's Ubuntu, this being an Ubuntu site ;) If you're running in a Windows host then you'll need to use Task Manager to change the priority but that's offtopic for Ask Ubuntu.– CaesiumNov 23, 2011 at 0:28
-
-
@Caesium I've edited, but I'm still not sure the post is correct with respect to the task at hand for VirtualBox. Most virtualization software uses multiple processes and you have to
renice
the correct one (the one that corresponds specifically to the particular virtual machine you want to get more CPU time). +It would be good to edit the post to give specific details about how to change a VM's RAM in VirtualBox, and how to change its number if CPU's. +Are you sureVirtualBox
is the right executable name? It's not listed at packages.ubuntu.com/oneiric/i386/virtualbox/filelist. Nov 23, 2011 at 22:21 -
@Eliah, good point about renice. VirtualBox is the right binary, see the virtualbox-qt package. You are correct, there could be several running, but sadly it starts them with a --startvm <hexstring> which isn't easy to see in the QT interface.– CaesiumNov 24, 2011 at 10:55