OpenShift Installation on GCP with Nested Vrtualization

Follow · 2 mins read
Share this

Warning: This is NOT tested multiple times; refere by your own risk

gcloud compute disks create crc-disk –image-project ubuntu-os-cloud –image-family ubuntu-1804-lts –zone us-central1-a gcloud compute images create crc-v4-image –source-disk crc-disk –source-disk-zone us-central1-a –licenses “”

#use this image to create a vm instance

use direct nested virtualization while createing VM


  • get the gcloud command from GCP console and add nested virtualization option at the end.
  • find the location availale with supported CPU options
$ gcloud compute instances create gcp-crc-openshift \
  --project=ak-hosting \
  --zone=us-central1-a \
  --machine-type=e2-standard-4 \
  --network-interface=network-tier=PREMIUM,subnet=default \
  --maintenance-policy=MIGRATE \
  --service-account=[email protected] \
  --scopes=,,,,, \
  --tags=http-server,https-server \
  --create-disk=auto-delete=yes,boot=yes,device-name=gcp-crc-openshift,image=projects/centos-cloud/global/images/centos-8-v20211214,mode=rw,size=50,type=projects/ak-hosting/zones/us-central1-a/diskTypes/pd-balanced \
  --no-shielded-secure-boot \
  --shielded-vtpm \
  --shielded-integrity-monitoring \
  --reservation-affinity=any \

sudo apt-get update sudo apt-get install –assume-yes qemu-kvm libvirt-daemon libvirt-daemon-system dnsmasq

sudo usermod -a -G libvirt $(whoami) sudo usermod -a -G libvirt-qemu $(whoami) sudo usermod -a -G libvirt-dnsmasq $(whoami)

sudo reboot

cat « EOF | sudo tee /etc/systemd/resolved.conf > /dev/null
[Resolve] DNS= Domains=apps-crc.testing crc.testing EOF

sudo sed -i ‘s/#listen-address=/listen-address=’ /etc/dnsmasq.conf

cat « EOF | sudo tee /etc/default/dnsmasq > /dev/null
DOMAIN_SUFFIX=`` ENABLED=1 CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new IGNORE_RESOLVCONF=yes EOF

cat « EOF | sudo tee /etc/dnsmasq.d/crc.conf > /dev/null
address=/crc.testing/ address=/apps-crc.testing/ server=/#/ EOF

sudo systemctl restart systemd-resolved sudo systemctl restart dnsmasq

dig foo.apps-crc.testing echo $(grep
dig api.crc.testing echo $(grep

curl -LO && tar -Jxvf crc-linux-amd64.tar.xz && mkdir -p ~/bin && export PATH=$PATH:~/bin && mv crc-linux/crc ~/bin/ && rm -rf crc

crc config set skip-check-network-manager-installed true crc config set skip-check-network-manager-config true crc config set skip-check-network-manager-running true crc config set skip-check-crc-dnsmasq-file true

crc setup

Download crc pull secret from and keep it in ~/.crc-pull-secret

nohup crc start -m 20480 -p ~/.crc-pull-secret &


#on the gcp ubuntu - nexted virtualization enabled vm, run the following

wget sudo apt update sudo dpkg –install chrome-remote-desktop_current_amd64.deb sudo apt install –assume-yes –fix-broken

#install xfce sudo DEBIAN_FRONTEND=noninteractive apt install –assume-yes xfce4 desktop-base sudo bash -c ‘echo “exec /etc/X11/Xsession /usr/bin/xfce4-session” > /etc/chrome-remote-desktop-session’ sudo apt install –assume-yes xscreensaver

#install chrome wget sudo dpkg –install google-chrome-stable_current_amd64.deb sudo apt install –assume-yes –fix-broken

Go to and follow the steps to enable remote access

Finally start using remote access from

Latest Stories