Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to build my Linux kernel on my host and use it in my VWware virtual machine. They both use the same Ubuntu kernel now.

On my Host, I do make and make configure. Then, what files should I copy to the target machine, before I do make modules_install and make install?

What other things do I need to do?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The 'best' way to do this, is building it as a package. You can then distribute and install it to any Ubuntu machine running the same (major) version.

For building vanilla kernels from source, there's a tool make-kpkg which can build the kernel as packages. Other major advantages: easy reverting by just removing the package, automatic triggers by the package management such as rebuilding DKMS, etc.

The Ubuntu community wiki on Kernel/Compile Alternate Build Method provides a few steps on how to do that.

Basically, it's just the same as building the kernel from upstream documentation, but instead of having make blindly installing it on your system, have it build in a 'fake root' environment and make a package out of it, using

fakeroot make-kpkg --initrd --append-to-version=-some-string-here \
  kernel-image kernel-headers

This should produce binary .deb files which you will be able to transfer to other machines and install it using

dpkg -i mykernelfile-image.deb mykernelfile-headers.deb ...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.