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?


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 ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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