LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-05-2009, 06:53 PM   #1
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Rep: Reputation: 15
linux VM


hey, im working on my project atm.
I want to create a customised Linux virtual machine which contains
latest Linux kernel and necessary device drivers and test if the virtual machine, new kernel and drivers work.

What are my first steps in doing it ?
 
Old 04-05-2009, 07:25 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
1. Choose the program you're going to use for Virtualization (VBox and VMWare are two Pop Favorites)

2. Download an .iso of your favorite distro (Ubuntu, Debian, SuSE, etc)

3. Create a new VM and install it from your .iso
Verify that it works (that you can boot, connect to the network, see your virtual HD, either virtual or physical CD/DVD and physical USB's, for example)

4. Clarify exactly what you mean by "customize"

5. Install the kernel source and GCC.
Verify you can build and install a new kernel (from the base kernel source)

6. "Customize" the kernel (whatever you decided in Step 4 above).

That's one approach. I'm sure you can easily think of many others.
 
Old 04-06-2009, 10:49 AM   #3
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
ok how do i boot up VMware with the installed linux OS on it? i have the latest 2.6.29.1 kernal. How then once VMware is booted configure the kernel, select necessary device drivers, and compile the
kernel?

thanks
 
Old 04-06-2009, 12:44 PM   #4
reptiler
Member
 
Registered: Mar 2009
Location: Hong Kong
Distribution: Fedora
Posts: 184

Rep: Reputation: 41
As I don't use VMWare I just guess that it's pretty much the same procedure as with all the other virtualization-solutions I have tried.
  1. Download install-CD/-DVD of the distro of your choice.
  2. Fire up VM, booting from the CD-/DVD-image.
  3. Install distro.
  4. Unpack your kernel, configure following one of the kernel-compilation-tutorials you can find all over the web (I've read there's at least one here, so looking for this might be useful too) and compile it and it's modules.
  5. Install the modules, copy the compiled kernel to /boot and add an entry in the boot-manager to be able to start the system with your custom kernel.
  6. Reboot, don't forget to choose your new kernel.
  7. Happy!

Also, what exactly do you want to do with the kernel? It seems to me that you simply want to run any distro in a VM and compile a custom kernel.
 
Old 04-06-2009, 06:01 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, orla999 -

A few clarifications (assuming this is all new to you):

1. Reptiler is right: most virtualization programs work pretty much the same.

2. You install all of them on your "host operating system" (the real PC) just as you would any other program. In the case of VMWare, you want "VMWare Workstation".

3. Most virtualization programs let you create new VM's (from scratch: exac tly like starting with a blank PC and an unformatted hard drive); most virtualization programs let you treat .iso files as though they were real, bootable CD's.

So, like Reptiler said: you download the .iso of your choice, create a new VM in the virtualization solution of your choice, and let the new VM boot from CD (to run "setup").

That takes us to step 3) on both my and Reptiler's "todo list" for you. If you've got a distro installed and running, you've made progress! The next step is to "customize" it...

Good luck .. PSM
 
Old 04-07-2009, 12:43 PM   #6
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
hi all, ok ive installed ubuntu on vmware. I have no put the image file on a disk, do i need to do this. At the minute i just opened vmware on vista, clicked new virtual machine and selected the ubuntu .iso file.

I am having trouble on what the next step is. I know about the terminal in ubuntu.
The next step is downloading the latest kernal (which i have downloaded) but how do i install this new kernal and compile it?

thanks guys!
 
Old 04-07-2009, 01:02 PM   #7
reptiler
Member
 
Registered: Mar 2009
Location: Hong Kong
Distribution: Fedora
Posts: 184

Rep: Reputation: 41
The question remains: Why do you think you need to have the latest kernel?
As you are obviously new to this (compiling a kernel) it is not so unlikely that you will miss out a few things which you may need in order to be able to start your system.

So, if you could tell us what your actual plan is, we may give some more specific advice.

Well, anyway, here the short instructions on how to compile a kernel:
  1. Unpack the archive: tar -xjf linux-2.6.29.1.tar.bz2
  2. Change into the kernel-tree: cd linux-2.6.29.1
  3. Configure the kernel: make menuconfig
    Take your time with this step. If unsure about an option, read it's help. If unsure about your hardware, use lspci to check what you have.
  4. Compile the kernel: make
  5. Install the modules: make modules_install
  6. Copy the compiled kernel to /boot: cp arch/x86/boot/bzImage /boot
  7. Adjust boot-loader configuration to allow selection of the new kernel on system-start.
 
Old 04-07-2009, 01:22 PM   #8
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
my intentions are:
Linux kernel compilation
i) Download the latest Linux kernel
ii) Configure the kernel and select necessary device drivers, and compile the kernel.

Load up the kernel with a boot loader
i) Configure the boot loader that comes with the distribution
ii) Boot your newly compiled kernel.

Do i use download the latest kernal to the desktop of ubuntu then use the terminal command tar -xjf linux-2.6.29.1.tar.bz2 to unpack it?
 
Old 04-07-2009, 02:17 PM   #9
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Yes. Once you've got your new VM running you can think of it as a completely separate machine at that point. Everything you need to do on that machine you should do on *that* machine. So download the latest kernel, and follow the detailed instructions reptiler provided. Note that you will likely want to keep the existing kernel option as the default so that your system remains bootable while you figure out what kernel options you need. During bootup press Esc to select your new kernel that you configured in the bootloader conf.

-Chad
 
Old 04-07-2009, 04:32 PM   #10
reptiler
Member
 
Registered: Mar 2009
Location: Hong Kong
Distribution: Fedora
Posts: 184

Rep: Reputation: 41
@orla999: Reading your posts I am somehow reminded of a topic I have recently dealt with on a German forum.
You don't happen to be this guy, do you?

For those who don't understand German I would like to explain the similarities.
  • No specific information what is supposed to be achieved.
    There the reason is "experimenting" with the kernel. No more detailed description could be gotten out of the user.
    Here I didn't see any reasons for doing this yet.
  • The whole thing seems pointless in both cases. Sure, it's a good thing to know how to compile a kernel, but it seems that learning this is not the goal of either user, there or here.

So, forgive me if I am wrong about this, but the similarities practically scream at me here.

So, as said, providing a bit more information about the purpose of this practice might help both you and us. Us to understand what the hell you are trying to achieve, you by finally getting some real information aimed towards reaching your goal.
 
Old 04-07-2009, 05:13 PM   #11
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
no i dont know him. to be honest with you i do not know the point in this excercise. As far as im aware i got to create a customised Linux virtual machine which consists of the latest Linux kernel and necessary device drivers and test if the virtual machine, new kernel and drivers work.
 
Old 04-07-2009, 05:30 PM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68


Assuming this isn't homework (of course it's not right?) and there are no restrictions on which VM to use, here's what I'd do:

Download Virtualbox: http://www.virtualbox.org

Install it on your host OS.

Download the latest Gentoo iso:
http://gentoo.osuosl.org/releases/x8...ilds/20090401/

Create a VM in virtualbox, bootup with the Gentoo CD and install:
http://www.gentoo.org/doc/en/handboo...x86.xml?full=1

When you install the kernel instead of using the gentoo-sources as suggested use the vanilla-sources.

Optionally use Slackware instead of Gentoo (faster install) and grab the kernel sources from http://www.kernel.org

Bam!
VM, latest kernel, bootable.

Option 2:
Grab a VMware appliance running either of the above already, install VMware workstation on your host OS, install the latest kernel from kernel.org in the appliance and:
Bam!
VM, latest kernel, bootable.

-Chad
 
Old 04-07-2009, 06:17 PM   #13
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
I having problems unpacking the linux kernel. i downloaded it to the desktop and typed the following (does the same without sudo):

ubuntu@ubuntu:~$ sudo tar -xjf linux-2.6.29.1.tar.bz2
tar: linux-2.6.29.1.tar.bz2: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
 
Old 04-07-2009, 06:26 PM   #14
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
That usually means the file isn't there or you are not typing it correctly. Try using TAB autocompletion. Also, ~ means you are in the home directory, not the Desktop. You may want to change to the desktop or mv the file to your home directory. To change to the desktop:
cd Desktop

And try again. This time type:
tar xvjf linuxTAB
Where TAB means you press the TAB key, and if the file exists (and is the only one named linux-something) then it will automatically complete the filename, then press enter.

-Chad
 
Old 04-07-2009, 06:45 PM   #15
orla999
LQ Newbie
 
Registered: Apr 2009
Posts: 29

Original Poster
Rep: Reputation: 15
ahhh that worked but another problem while unpacking:

tar: linux-2.6.29.1/virt/kvm/kvm_trace.c: Cannot open: No such file or directory

and it did this for every item in the linux-2.6.29.1 folder?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:59 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration