This repository provides scripts for creating a minimal Debian image, running a Linux kernel using QEMU/KVM, and accessing the VM via SSH. The setup allows you to easily test and develop with a custom Linux kernel in a lightweight virtualized environment.
create-image.sh
: Script to build a minimal Debian image.run.sh
: Script to start a QEMU/KVM instance running the Linux kernel.enter.sh
: Script to log into the QEMU VM via SSH.
Before you begin, ensure you have the following installed on your system:
The create-image.sh
script builds a minimal Debian image. To run this script, execute the following command in your terminal:
./create-image.sh
This script will create a root filesystem that can be used by the QEMU/KVM instance.
Once you have the minimal image created, you can start the QEMU/KVM instance using the provided run.sh
script. Make sure to have your Linux kernel image (bzImage) available in the same folder. You can run the script as follows:
./run.sh
This command will launch the QEMU instance with the following configurations:
- The created Debian root filesystem will be used as the root for the VM.
- The networking model is set to 'user', which avoids any complex configuration on the host machine.
To log into the QEMU VM, use the enter.sh
script which sets up port forwarding for SSH. Run the following command:
./enter.sh
This script configures your SSH client to connect to the VM via localhost
on port 10022
. You can access the VM by executing:
ssh -i <certificate> -p 10022 root@localhost
Note that 'certificate' is created during the image creation and is available in the root folder.
- Ensure that the QEMU/KVM process has sufficient permissions to run and access the required resources.
- If you encounter any issues, check the logs generated by QEMU for debugging.
- Modify the scripts as needed to fit your specific use case or environment.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! If you have suggestions or improvements, please feel free to submit a pull request.