LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-23-2011, 06:34 PM   #1
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Rep: Reputation: 21
CentOS running on Ubuntu's VirtualBox


I'm trying to experiment with Linux kernels. I have only one system with Ubuntu installed on it. There is a good chance that I'll screw up if I play with Ubuntu's kernel. So I've decided to play with CentOS running on VirtualBox from Ubuntu.

I have a few questions about this:
1. Any website suggestions explaining how to install CentOS on VirtualBox ? I searched the internet, but most links explain how to install VirtualBox on CentOS, and not the other way round.
2. Is is possible to compile and run custom kernels from CentOS running on VirautlBox ?
3. Does VirtualBox run bootloaders (like Grub, Lilo, etc.) so that I can switch between custom and stock kernels during VM bootup.

Thanks in advance !
-wb
 
Old 04-23-2011, 07:01 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
There seems to be a lack of understanding. Virtualbox will give you a Virtual Machine (VM), that means it emulates a complete PC, and this PC will behave exactly like a physical PC.
So here the answers to your questions:
1. You can install CentOS on Virtualbox exactly like you would do on a physical PC. At first you have to set up your VM, you can use the wizard for that. More information on setting up a VM with Virtualbox can be found here. After that you simply start that VM and install CentOS, like you would do on any other machine. You will need to download an iso-image of the CentOS install-DVD for that. More info on the first start of a VM and installing an OS can be found here.

2. Since it behaves like a physical PC, in short: Yes.
3. Since it behaves like a physical PC, in short: Yes.

I would recommend to go through the Virtualbox manual before setting up the VM. This will help you to get a better understanding of how Virtualbox works and which choices you have.
 
1 members found this post helpful.
Old 04-23-2011, 08:45 PM   #3
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Original Poster
Rep: Reputation: 21
TobiSGD,thanks for your answers ! I know a bit about virtualization in theory, but haven't actually used a VM software before. Since I was in a bit of a hurry to work on kernel, I thought I'd check with the experts here
 
Old 04-23-2011, 08:49 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I currently have a CentOS VM on this here Ubuntu box.

Install VirtualBox. In Synaptic or Ubuntu Software Center or apt, make sure you get the VirtualBox-OSE, VirtualBox Guest Additions, and VirtualBox-dkms packages. You will need the dkms packages for installing the VirtualBox Guest Additions in the CentOS VM.

Then install CentOS just as if you were installing it on a computer.

Here's a link to a series of blog posts I wrote on just this issue. In this case, I was installing CentOS in VB on Debian, but the procedure is the same.

The post I linked to (Part 4) links to the other posts in the series.
 
Old 04-23-2011, 09:22 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by frankbell View Post
You will need the dkms packages for installing the VirtualBox Guest Additions in the CentOS VM.
I think you are wrong here, the DKMS packages are for building/rebuilding the kernel-modules for Virtualbox on the host. Without this modules you will only get software-virtualization, which can be really slow.
 
Old 04-24-2011, 04:29 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Virtualbox will only work until the kernel has been updated. DKMS will tell virtualbox and other programs that may need to follow.
 
Old 04-25-2011, 07:27 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Quote:
Originally Posted by TobiSGD View Post
I think you are wrong here, the DKMS packages are for building/rebuilding the kernel-modules for Virtualbox on the host. Without this modules you will only get software-virtualization, which can be really slow.
To get the full benefit of Guest Additions, the Guest Additions installation script for OS in the VM needed to recompile the kernel to install all its features, such as sharing folders between the host and guest. I think I remember VirtualBox's complaining that I didn't have DKMS installed when I tried that the first time, but it's been a while since I got it working and the details are hazy.

I could well have gotten the memories confused.

Also, inside the CentOS VM, I had to install gcc, the kernel sources, and the libraries for compiling against the kernel (it's been a while and I forget their official names) since they did not install by default.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Running Virtual Machines With VirtualBox 4.0 On A Headless Ubuntu 10.10 Server LXer Syndicated Linux News 0 12-27-2010 03:10 PM
can't kickstart CentOs on VirtualBox VM geek.ksa Linux - Virtualization and Cloud 3 08-29-2010 09:35 AM
CentOS in one VirtualBox, Windows in another - can I set up Samba in the CentOS VB? ismism Linux - Newbie 10 08-08-2010 03:34 PM
LXer: VBoxHeadless - Running VirtualBox 2.0 On A Headless Ubuntu 8.04 Server LXer Syndicated Linux News 0 09-25-2008 07:12 PM
networking in centos (through virtualbox) sycamorex Linux - Wireless Networking 4 09-16-2008 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration