diff --git a/docs/devenv_cloud.md b/docs/devenv_cloud.md index e67d998e6f..bb01aa062e 100644 --- a/docs/devenv_cloud.md +++ b/docs/devenv_cloud.md @@ -116,8 +116,9 @@ In the [Install MicroShift for Edge](./rhel4edge_iso.md#install-microshift-for-e ```bash VMNAME=microshift-edge NETNAME=default +ISO=$(ls -1 "_output/image-builder/microshift-installer-*.$(uname -m).iso") -./scripts/image-builder/create-vm.sh $VMNAME $NETNAME +./scripts/image-builder/create-vm.sh $VMNAME $NETNAME $ISO ``` > The RHEL for Edge host is created with 2 cores and 3 GB of RAM to allow for a better performance in a nested virtualization environment. diff --git a/scripts/image-builder/create-vm.sh b/scripts/image-builder/create-vm.sh index 82fffe7feb..ac80442079 100755 --- a/scripts/image-builder/create-vm.sh +++ b/scripts/image-builder/create-vm.sh @@ -1,27 +1,24 @@ #!/bin/bash set -e -ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )" -ISODIR=${ROOTDIR}/_output/image-builder - -if [ $# -ne 2 ] ; then - echo "Usage: $(basename "$0") " +if [ $# -ne 3 ] ; then + echo "Usage: $(basename "$0") " exit 1 fi VMNAME=$1 NETNAME=$2 -CDROM=$(ls -1 "${ISODIR}/microshift-installer-*.$(uname -m).iso" 2>/dev/null || true) +CDROM=$3 if [ ! -e "${CDROM}" ] ; then - echo "The image ISO '${CDROM}' file does not exist. Run 'make iso' to create it" + echo "The image ISO '${CDROM}' file does not exist." exit 1 fi sudo dnf install -y libvirt virt-manager virt-install virt-viewer libvirt-client qemu-kvm qemu-img sshpass if [ "$(systemctl is-active libvirtd.socket)" != "active" ] ; then - echo "Restart your host to initialize the virtualization environment" - exit 1 + echo "Enabling libvirtd" + sudo systemctl enable --now libvirtd fi # Necessary to allow remote connections in the virt-viewer application sudo usermod -a -G libvirt "$(whoami)"