Hey,
I hav created and (alpine 3.23) backed container and installed bash and dialog in it. When I try to run the simple script below, the dialog command fails with
cannot open tty-output
(I've successfully run this simple script in macos 15.7.3, ubuntu 24.04.3, and
proxmox-ve: 9.1.0 (running kernel: 6.17.4-1-pve)).
Can anyone advise on how I can get dialog to work in a container?
Thank in advance.
The container config is
I hav created and (alpine 3.23) backed container and installed bash and dialog in it. When I try to run the simple script below, the dialog command fails with
cannot open tty-output
(I've successfully run this simple script in macos 15.7.3, ubuntu 24.04.3, and
proxmox-ve: 9.1.0 (running kernel: 6.17.4-1-pve)).
Can anyone advise on how I can get dialog to work in a container?
Thank in advance.
Bash:
#!/bin/bash
USER_INPUT=$(dialog --output-fd 1 --title "User Input" --backtitle "LXC Demo" \
--inputbox "Enter a value:" 10 40 )
#echo ${USER_INPUT}
# Check the exit status of the dialog command (0 for OK, 1 for Cancel)
if [ $? -eq 0 ]; then
echo "Captured input: $USER_INPUT"
else
echo "User cancelled input."
fi
The container config is
INI:
arch: amd64
cmode: console
cores: 1
entrypoint: /bin/sh
env: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
features: nesting=1
hostname: test-ct
memory: 1024
nameserver: 192.168.1.1
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,host-managed=1,ip=192.168.36.191/16,type=veth
onboot: 1
ostype: alpine
rootfs: local-lvm:vm-104-disk-0,size=1G
searchdomain: home
startup: 3
swap: 0
timezone: America/New_York
unprivileged: 1
lxc.init.cwd: /
lxc.signal.halt: SIGTERM