#!/usr/bin/expect -f set timeout -1 #Start the guest VM spawn vm /srv/vm/f25.img -nographic expect "login: " send "a\r" expect "Password: " send "a\r" expect "$ " send "echo a | sudo --stdin dnf update -y\r" expect "$ " send "echo a | sudo --stdin poweroff\r" expect "$ "