2017年10月4日 星期三

以 chvt 遠端切換本機 tty

切換到第 num 個 tty
$ chvt [num]
出現
Couldn't get a file descriptor referring to the console
改用
$ sudo chvt [num]

列出所有 tty
$ w

打算讓電腦顯示卡晚上做點事,
但是留在有啟用 X 的 tty1 可能會造成 X server 問題,
所以都換到 tty2 的文字界面執行。

遇到用 TigerVNC 連接時都是出現全黑畫面,
或是畫面固定不動,
但是滑鼠操作會有效果。
測試後是沒切換回啟用 X 的 tty1。

找到用 chvt 1 可以切換回 tty1 ,
但是平常是用 tmux 執行,
$ chvt 1
Couldn't get a file descriptor referring to the console

需改使用 sudo 權限
$ sudo chvt 1

w 可以查總共登入幾個 tty
$ w
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
myid    tty1      11:10    1:54m 21:11   0.00s xinit /home/myid/.xinitrc -- /
myid    tty2      13:04    6.00s  0.00s  0.00s -bash


沒有留言:

張貼留言