diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init index 57a4690..dd90e64 100755 --- a/virtme/guest/virtme-init +++ b/virtme/guest/virtme-init @@ -68,6 +68,12 @@ fi touch /tmp/fstab mount --bind /tmp/fstab /etc/fstab +if [[ -n "$virtme_hostname" ]]; then + cp /etc/hosts /tmp/hosts + printf '\n127.0.0.1 %s\n::1 %s\n' "$virtme_hostname" "$virtme_hostname" >> /tmp/hosts + mount --bind /tmp/hosts /etc/hosts +fi + # Fix dpkg if we are on a Debian-based distro if [ -d /var/lib/dpkg ]; then lock_files=(/var/lib/dpkg/lock /var/lib/dpkg/lock-frontend /var/lib/dpkg/triggers/Lock) diff --git a/virtme_ng/run.py b/virtme_ng/run.py index 19bbd7f..7b897c5 100644 --- a/virtme_ng/run.py +++ b/virtme_ng/run.py @@ -205,7 +205,10 @@ def make_parser(): parser.add_argument("--qemu", action="store", help="Use the specified QEMU binary") parser.add_argument( - "--name", action="store", help="Set guest hostname and qemu -name flag" + "--name", + action="store", + default="virtme-ng", + help="Set guest hostname and qemu -name flag" ) parser.add_argument( diff --git a/virtme_ng_init b/virtme_ng_init index f20306d..dcefa64 160000 --- a/virtme_ng_init +++ b/virtme_ng_init @@ -1 +1 @@ -Subproject commit f20306df2a97a83683db94e8427a6e0d4b6b6ddc +Subproject commit dcefa64504ce41f6da8d9d5ef31bb8d10a6ecf89