2 # Run this script before starting the presention/demo.
3 # Before you must run "make download".
6 # specific for Martin Pitt
7 VM_PREFIX="toolbox run -c devel"
9 printf '[Session]\nIdleTimeout=0\n' | sudo tee /etc/cockpit.cockpit.conf
10 sudo systemctl stop cockpit
12 echo '127.0.0.2 cockpit.dev' | sudo tee -a /etc/hosts
14 # FIXME: AVC avc: denied { name_connect } for pid=52827 comm="cockpit-ssh" dest=2209 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
18 sudo modprobe scsi_debug dev_size_mb=512
20 m=$(cat /sys/block/sdb/device/model)
21 [ "${m%% *}" = scsi_debug ]
23 cat <<EOF | sudo sfdisk /dev/sdb
29 /dev/sdb1 : start= 2048, size= 524288, type=83
30 /dev/sdb2 : start= 526336, size= 522240, type=83
32 sudo pvcreate /dev/sdb1
33 sudo vgcreate vg0 /dev/sdb1
34 sudo lvcreate -n data1 -l '100%FREE' vg0
35 sudo mkfs.ext4 -L data1 /dev/vg0/data1
37 firefox http://localhost:9090/storage
39 # for remote ssh session demo
40 $VM_PREFIX sh -exc "cd $PWD"'
42 env TEST_DATA=/tmp bots/machine/testvm.py rhel-7-8 > /tmp/r7vm &
43 echo $! > /tmp/r7vm.pid
45 read ssh_cmd < /tmp/r7vm
46 echo "ssh command: $ssh_cmd"
47 read _ < /tmp/r7vm # URL, uninteresting
48 read running < /tmp/r7vm
49 [ "${running#RUNNING}" != "$running" ] # sanity check
52 $ssh_cmd hostnamectl set-hostname server1
57 sleep 20 # let the above VM initialize
60 xhost +local: # allow X in toolbox
62 ===============================================================
64 - In virt-viewer window, open Edge and log into https://10.0.2.2:9090
65 - Press F11 for fullscreen
66 - Minimize browser, to show the desktop
67 - When done, close virt-viewer (F11 and Ctrl+Shift+Q) to resume this script
68 ===============================================================
70 $VM_PREFIX `pwd`/bots/vm-run -C2 windows-10
74 ===============================================================
75 ssh demo: rhel-7-8 VM is still running, host name "cockpit.dev"
76 When done, press Enter to clean up and finish
77 ===============================================================
85 $VM_PREFIX sh -xc 'kill $(cat /tmp/r7vm.pid); rm -rf /tmp/r7vm.pid /tmp/tmp'
89 sudo rm -f /etc/cockpit.cockpit.conf /etc/cockpit/machines.d/* /etc/ssh/ssh_known_hosts
90 sudo sed -i '/^127.0.0.2 cockpit.dev$/d' /etc/hosts