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 foreman-webconsole.webm
38 firefox http://localhost:9090/storage
40 # for remote ssh session demo
41 $VM_PREFIX sh -exc "cd $PWD"'
43 env TEST_DATA=/tmp bots/machine/testvm.py rhel-7-8 > /tmp/r7vm &
44 echo $! > /tmp/r7vm.pid
46 read ssh_cmd < /tmp/r7vm
47 echo "ssh command: $ssh_cmd"
48 read _ < /tmp/r7vm # URL, uninteresting
49 read running < /tmp/r7vm
50 [ "${running#RUNNING}" != "$running" ] # sanity check
53 $ssh_cmd hostnamectl set-hostname server1
58 sleep 20 # let the above VM initialize
61 xhost +local: # allow X in toolbox
63 ===============================================================
65 - In virt-viewer window, open Edge and log into https://10.0.2.2:9090
66 - Press F11 for fullscreen
67 - Minimize browser, to show the desktop
68 - When done, close virt-viewer (F11 and Ctrl+Shift+Q) to resume this script
69 ===============================================================
71 $VM_PREFIX `pwd`/bots/vm-run -C2 windows-10
75 ===============================================================
76 ssh demo: rhel-7-8 VM is still running, host name "cockpit.dev"
77 When done, press Enter to clean up and finish
78 ===============================================================
86 $VM_PREFIX sh -xc 'kill $(cat /tmp/r7vm.pid); rm -rf /tmp/r7vm.pid /tmp/tmp'
90 sudo rm -f /etc/cockpit.cockpit.conf /etc/cockpit/machines.d/* /etc/ssh/ssh_known_hosts
91 sudo sed -i '/^127.0.0.2 cockpit.dev$/d' /etc/hosts