image_to_vm.sh: make GPU sandbox failures non-fatal.

BUG=chromium:327824
TEST=Build VM, check session_manager_setup.sh and running processes for flag.
TEST=Trybots: lumpy, link, leon, daisy.
CQ-DEPEND=CL:190514

Change-Id: Idc898fbd638963efb564832d1008d3acaabd9383
Reviewed-on: https://chromium-review.googlesource.com/190792
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/image_to_vm.sh b/image_to_vm.sh
index f02f664..31bf85c 100755
--- a/image_to_vm.sh
+++ b/image_to_vm.sh
@@ -149,7 +149,7 @@
 # Modify the unverified usb template which uses a default usb_disk of sdb3
 sudo sed -i -e 's/sdb3/sda3/g' "${TEMP_MNT}/boot/syslinux/usb.A.cfg"
 
-# add loading of cirrus fb module
+# Add loading of cirrus fb module
 if [ "${FLAGS_format}" = "qemu" ]; then
   sudo_clobber "${TEMP_MNT}/etc/init/cirrusfb.conf" <<END
 start on starting boot-splash
@@ -157,7 +157,12 @@
 exec modprobe cirrus
 END
 fi
-# TODO as these image modifying hacks accumulate, we should consider
+
+# Make GPU sandbox failures nonfatal on VMs.
+sudo sed -i -r -e 's/^(GPU_FLAGS)="(.*)=yes"/\1="\2=no"/g' \
+  "${TEMP_MNT}/sbin/session_manager_setup.sh"
+
+# TODO as these image-modifying hacks accumulate, we should consider
 # creating a better solution
 
 # Unmount everything prior to building a final image