From b6410cce7d2e429addaf4cc6a4a2da10173abfad Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 6 Oct 2017 14:12:23 -0300 Subject: Doc: using with existing or manually created guests --- README.md | 30 ++++++++++++++++++++++++++++++ kvmx | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e18f49..6d9df06 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,36 @@ you might have available on your shell. If no project name is specified, the current folder name is assumed as the project name. If no folder is specified, the current folder is assumed as the project home. +## Using with existing guests + +Instead of a simple `kvmx up`, you might want to use and existing virtual machine. +Simply point the `image` parameter at your project's `kvmxfile` to where you image +resides. + +## Manually creating a guest + +Alternativelly, you might create a new one by hand. To do so, proceed as usual +with `kvmx init` and `kvmx edit` acording to the Basic Usage stated above. + +Then, before, doing `kvmx up`, do something like the following example: + + # Create the environment + kvmx init /var/cache/qemu/ + cd /var/cache/qemu/ + qemu-img create -f raw box.raw 10G + + # Install the Operating System + kvm -m 2048 -net nic,model=virtio -net user -drive file=box.raw,format=raw -cdrom ~/path/to/installation.iso + + # Convert image to qcow2 format + qemu-img convert -O qcow2 bow.raw box.img + +If you want OpenSSH functionality, make sure to create an user and set a password +related to the configuration present at the project's `kvmxfile`. Also, make sure +to to create an OpenSSH keypair for this virtual machine and put the public key +into the guest user's home folder. Passwordless sudo might also be desired for the +full development functionality. + ## Further development * Fix isolinux support: diff --git a/kvmx b/kvmx index 4369de1..2ed3dd4 100755 --- a/kvmx +++ b/kvmx @@ -359,7 +359,7 @@ function kvmx_up { -device virtio-serial-pci \ -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \ -chardev spicevmc,id=spicechannel0,name=vdagent \ - -smp $smp -soundhw ac97 -cpu host -balloon virtio \ + -smp $smp -soundhw ac97 -cpu host -balloon virtio \ -net nic,model=virtio \ -net user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd $qemu_opts &> $LOGFILE < /dev/null & -- cgit v1.2.3