From a62b9b5b7d9e77a7916b5932e547b621abb8dc96 Mon Sep 17 00:00:00 2001
From: Jeffrey Tolar <tolar.jeffrey@gmail.com>
Date: Fri, 19 Aug 2016 02:14:57 -0500
Subject: [PATCH] Only start X if it's installed

---
 create_vm.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/create_vm.sh b/create_vm.sh
index 72e0af5..2b5dc00 100644
--- a/create_vm.sh
+++ b/create_vm.sh
@@ -171,7 +171,7 @@ gettyEOF
 
 
 # autostart X (xfce) on tty1
-echo '[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && exec startx' >> /home/$DEFAULT_USER/.bashrc
+echo '[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 && -x /usr/bin/startx ]] && exec startx' >> /home/$DEFAULT_USER/.bashrc
 chown $DEFAULT_USER:$DEFAULT_USER /home/$DEFAULT_USER/.bashrc
 cat > /home/$DEFAULT_USER/.xinitrc <<"xinitrcEOF"
 #!/bin/sh
-- 
GitLab