What Is vmlinuz? The Linux Kernel File Explained
What is the vmlinuz file?
If you’ve ever looked into your Linux system’s /boot directory, you’ve surely come across a file with the mysterious name vmlinuz (or vmlinuz-6.5.0-generic, etc.). This is one of the most important files in the entire system – it’s the compressed, bootable image of the Linux kernel.
In short, this is the file that is loaded into memory by the bootloader (like GRUB) when the computer starts. Once loaded, a small piece of code inside vmlinuz decompresses the rest of the kernel into RAM and then transfers control to it, beginning the actual startup process of the operating system.
Fun Fact #1: What does the name vmlinuz mean?
The name vmlinuz is not accidental. It’s an acronym that can be broken down into parts, each with historical significance:
vm: Stands for “Virtual Memory”. In the early days of Linux, kernels that supported virtual memory (which is standard today) had this prefix to distinguish them from older versions that did not.linu: This is simply short for “Linux”.z: This indicates that the kernel image is compressed, most often using the gzip algorithm. It is this compression that makes the file much smaller than its raw counterpart,vmlinux. Modern kernels can also use other compression algorithms, such aslzma,xz,lzo,lz4, orzstd.
Fun Fact #2: vmlinux vs vmlinuz
You might also often come across a file named vmlinux (without the “z” at the end). What’s the difference?
vmlinux: This is the raw, uncompressed, non-bootable kernel image. It contains all the debugging symbols and is in ELF format. It is huge compared tovmlinuzand is mainly used for debugging and analyzing the kernel with tools likegdborcrash.vmlinuz: This is the compressed and “stripped” version ofvmlinux, prepared specifically for booting the system.
The process of creating vmlinuz from vmlinux involves removing unnecessary information, compressing it, and adding a small startup code responsible for decompression.
Fun Fact #3: What about bzImage?
When compiling the kernel, the command make bzImage is often used. Many people think that bz stands for bzip2 compression. Nothing could be further from the truth!
Historically, the first compressed kernel image was called zImage (from “compressed Image” – “z” as in gzip compression). However, it had a limitation – the entire compressed kernel had to fit into the first 640 KB of memory. As the kernel grew, this became a problem.
So, the bzImage format was introduced, where bz stands for “big zImage”, not bzip2. bzImage also uses gzip compression (or newer ones like lzo, xz, lz4, zstd), but thanks to a different memory organization, it allows for loading much larger kernel images.
Fun Fact #4: vmlinuz vs bzImage — Are They the Same?
Short answer: yes, practically the same. The difference is only in naming:
bzImage— this is the format and build target (make bzImage). The resulting file is located inarch/x86/boot/bzImage.vmlinuz— this is the filename in the/bootdirectory, where the installer copies the compiled bzImage.
When you run make install after compiling the kernel, the installation script copies arch/x86/boot/bzImage to /boot/vmlinuz-<version>. It’s literally the same file, just under a different name.
Why Two Names?
- bzImage describes how the file was built (the “big zImage” format for x86).
- vmlinuz describes what it is (a compressed kernel with virtual memory support).
The name vmlinuz is more universal — it’s used regardless of architecture. On ARM or RISC-V there’s no “bzImage”, but /boot/vmlinuz still exists.
You Can Verify This
# After kernel compilation, compare the files:
cmp arch/x86/boot/bzImage /boot/vmlinuz-$(uname -r)
# If nothing is printed — the files are identical
# Check the compression type of vmlinuz:
file /boot/vmlinuz-$(uname -r)
# Example output: Linux kernel x86 boot executable bzImage, version 6.5.0...
Summary
- vmlinux — raw, uncompressed kernel image (for debugging)
- zImage — old compressed format, ~512 KB limit
- bzImage — modern “big zImage” format (
make bzImagetarget) - vmlinuz — filename in
/boot— usually a copy of bzImage
The vmlinuz file is the heart of our system during startup. Its name and format are the result of decades of Linux kernel evolution – from simple beginnings, through the addition of virtual memory, to the need to load ever larger and more complex kernels. And if someone asks you “is vmlinuz the same as bzImage?” — you can confidently answer: yes, it’s the same file, just under a different name.