Good evening everyone!
A few hours ago I was running some long running commands on one of my PVE hosts to install an LXC. However, as I had to close my laptop in a hurry, I was disconnected from my VPN and therefore lost my TTY session to the PVE node. As you'll probably all be aware, when you close a host / hypervisor / node NoVNC web-TTY, you generally do not simply re-open it later like an LXC or of course a virtual machine... Though, of course you can make a VM have selectable text by converting it to a TTY if you need say a lot of security to prevent the VPN from reaching the VM's network or don't want SSH... I digress.
So tonight, I had to reclaim this TTY shell and discovered REPTYR which will take over an entire terminal rather than bringing a command from one TTY to another or killing a process and restarting it elsewhere. So in this case:
My shell was under PID 3407589 so thanks to REPTYR all I needed to do was run:
Thanks,
Tmanok
A few hours ago I was running some long running commands on one of my PVE hosts to install an LXC. However, as I had to close my laptop in a hurry, I was disconnected from my VPN and therefore lost my TTY session to the PVE node. As you'll probably all be aware, when you close a host / hypervisor / node NoVNC web-TTY, you generally do not simply re-open it later like an LXC or of course a virtual machine... Though, of course you can make a VM have selectable text by converting it to a TTY if you need say a lot of security to prevent the VPN from reaching the VM's network or don't want SSH... I digress.
So tonight, I had to reclaim this TTY shell and discovered REPTYR which will take over an entire terminal rather than bringing a command from one TTY to another or killing a process and restarting it elsewhere. So in this case:
Code:
root@pve5:~# ps aux | grep -e apt -e dpkg
root 45613 0.0 0.0 6332 1536 pts/0 S+ 00:56 0:00 grep -e apt -e dpkg
root 3407589 0.0 0.0 10580 3456 pts/15 S+ Nov14 0:00 dpkg <redacted ;)>
My shell was under PID 3407589 so thanks to REPTYR all I needed to do was run:
reptyr -T 3407589 and I regained my TTY completely! This isn't like when you latch back on to an LXC TTY either (or a VM with Serial TTY output) where you need to press ENTER/RETURN on your keyboard to bring anything up, it's exactly where I left it showing me a DPKG menu and everything). Maybe this is obvious already to many folks but somehow I've gone all these years without needing this (just my dumb luck today trying to mess with the hypervisor in a new lab environment, I'm preparing for a colocation facility move). Thanks,
Tmanok