qemunet:debian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qemunet:debian [2016/09/06 10:17] – orel | qemunet:debian [2016/09/14 08:01] (current) – removed orel | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== How to install a Debian Linux System for QemuNet? ====== | ||
- | |||
- | QemuNet uses standard QEMU disk file in raw format. So you can follow any tutorial available for QEMU. Here is a simple example on how to install a //debian8// system for QEMU. | ||
- | |||
- | ==== Build a Standard QEMU Image ==== | ||
- | |||
- | Depending on your host configuration, | ||
- | |||
- | < | ||
- | # download the iso for your favorite system | ||
- | wget http:// | ||
- | |||
- | # create a disk image for your VM (8G) | ||
- | qemu-img create debian.img 8G | ||
- | |||
- | # install your VM from cdrom | ||
- | qemu-system-x86_64 -enable-kvm -hda debian.img -cdrom debian-8.3.0-amd64-netinst.iso -boot d -m 512 | ||
- | |||
- | # after installation is complete, reboot your VM and test it | ||
- | qemu-system-x86_64 -enable-kvm -hda debian.img -m 512 | ||
- | |||
- | </ | ||
- | |||
- | __Nota Bene__ : If you would like to copy/paste this latter line, unfortunately this is not possible with the standard QEMU display based on SDL. However, the //xterm// QemuNet option, described in the previous section will help you ;-) | ||
- | |||
- | In order to use your //debian8// in QemuNet, you need to add a new entry in // | ||
- | |||
- | <code bash qemunet.cfg> | ||
- | # IMGDIR="/ | ||
- | if [ -z " | ||
- | |||
- | # debian testing | ||
- | SYS[debian8]=" | ||
- | FS[debian8]=" | ||
- | QEMUOPT[debian8]=" | ||
- | </ | ||
- | |||
- | Now, you can test your system in QemuNet in __standalone mode__. This mode is useful to complete your installation before to use it for virtual networking. In this mode, you have a direct access to disk image in raw format. | ||
- | |||
- | < | ||
- | ./ | ||
- | </ | ||
- | |||
- | |||
- | ==== Some Basic Tips for QemuNet ==== | ||
- | |||
- | ==Install your packages== | ||
- | |||
- | < | ||
- | apt-get install emacs-nox jed vim nano python-scapy tcpdump tshark \ | ||
- | dnsmasq dsniff xterm apache2 telnetd ftpd openvpn openssl vlan bridge-utils | ||
- | </ | ||
- | |||
- | ==Upgrade your system== | ||
- | |||
- | First, edit "/ | ||
- | |||
- | deb http:// | ||
- | deb-src http:// | ||
- | deb http:// | ||
- | |||
- | Then update your system... | ||
- | |||
- | < | ||
- | apt-get update | ||
- | apt-get upgrade | ||
- | </ | ||
- | |||
- | ==Remove root password== | ||
- | |||
- | To do this, check you have " | ||
- | |||
- | ==Disable dynamic configuration for eth0== | ||
- | |||
- | Edit / | ||
- | |||
- | < | ||
- | dhclient eth0 | ||
- | </ | ||
- | |||
- | ==Closing standalone session== | ||
- | |||
- | Remove / | ||
- | |||
- | |||
- | ==== Some Advanced Tips for QemuNet ==== | ||
- | |||
- | QemuNet provides some advanced options, that are specific for " | ||
- | |||
- | |||
- | == Mount shared directory == | ||
- | |||
- | The mount option (-m) is useful to share files between host and guest system files. In your QemuNet session directory (-s session_dir), | ||
- | |||
- | To do this, you need to add the following line in /etc/fstab of your VM system file: | ||
- | |||
- | host / | ||
- | |||
- | Dont forget to create /mnt/host directory. Here, //nofail// is important to enable the VM to boot without the ' | ||
- | |||
- | |||
- | == Run VM in xterm terminal == | ||
- | |||
- | The xterm option (-x) is useful to launch your Linux VM in no-graphic mode inside xterm, instead of the native SDL mode. For instance, it allows copy/paste with other VM xterm windows. Moreover, you can resize the xterm window without any problem. Simply, type commands: //resize// and/or //reset// to update xterm. | ||
- | |||
- | To do this, you need to extract both kernel and initrd files from the VM raw disk image, and to provide it to QemuNet configuration file. | ||
- | |||
- | Basically, you can get these files by copying them from /boot to the /mnt/host shared directory (see previous tips). Easy ;-) | ||
- | |||
- | Else, you can try the following instructions on your host, that requires root privilege. | ||
- | |||
- | < | ||
- | sudo losetup /dev/loop0 debian.img | ||
- | sudo kpartx -a /dev/loop0 | ||
- | sudo mount / | ||
- | cp / | ||
- | cp / | ||
- | </ | ||
- | |||
- | Then, update // | ||
- | |||
- | <code bash qemunet.cfg> | ||
- | # IMGDIR="/ | ||
- | if [ -z " | ||
- | |||
- | # debian8 | ||
- | SYS[debian8]=" | ||
- | FS[debian8]=" | ||
- | QEMUOPT[debian8]=" | ||
- | KERNEL[debian8]=" | ||
- | INITRD[debian8]=" | ||
- | </ | ||
- | |||
- | |||
qemunet/debian.1473157035.txt.gz · Last modified: 2024/03/18 15:05 (external edit)