How to access agetty terminals (e.g. TTY2, 3, 4, etc.) from QEMU VM

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












In my QEMU virtual machine (started with qemu-kvm -boot d arch-freebsd.img -m 4096) I'd like to access an agetty terminal, which I'd normally access with Ctrl+Alt+F2 (or F3 if I need tty3, F4 if tty4, etc.), unfortunately pressing these keys just merely changes me to an agetty terminal on my host (as opposed to the guest system I'm trying to go to tty2 in). If this were a VirtualBox VM I'd press Ctrl+F2 (specifically the Ctrl in the centre of my keyboard, i.e. my right Ctrl key) to access tty2, but this doesn't work with QEMU. If you suggest I press Ctrl+Alt+G to get the VM to grab all my keyboard and mouse inputs, then pressing the keys to access the agetty terminals I've tried doing that and it doesn't work.



EDIT: The proposed duplicate link doesn't list what solved my problem, pressing Alt+Fx. I've tried Ctrl+Alt+Fx that seems to be suggested there (although I'm having trouble getting my head around what it's about as what VNC is, is a mystery to me), that's kind of the problem here.










share|improve this question























  • What about the TTY you're on? Is it running agetty?
    – muru
    Aug 13 at 8:54










  • I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
    – Brenton Horne
    Aug 13 at 8:57







  • 1




    Potential answerers may be interested in askubuntu.com/questions/54814 .
    – JdeBP
    Aug 13 at 9:03






  • 1




    Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
    – muru
    Aug 13 at 9:07






  • 1




    It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
    – JdeBP
    Aug 13 at 9:12














up vote
0
down vote

favorite












In my QEMU virtual machine (started with qemu-kvm -boot d arch-freebsd.img -m 4096) I'd like to access an agetty terminal, which I'd normally access with Ctrl+Alt+F2 (or F3 if I need tty3, F4 if tty4, etc.), unfortunately pressing these keys just merely changes me to an agetty terminal on my host (as opposed to the guest system I'm trying to go to tty2 in). If this were a VirtualBox VM I'd press Ctrl+F2 (specifically the Ctrl in the centre of my keyboard, i.e. my right Ctrl key) to access tty2, but this doesn't work with QEMU. If you suggest I press Ctrl+Alt+G to get the VM to grab all my keyboard and mouse inputs, then pressing the keys to access the agetty terminals I've tried doing that and it doesn't work.



EDIT: The proposed duplicate link doesn't list what solved my problem, pressing Alt+Fx. I've tried Ctrl+Alt+Fx that seems to be suggested there (although I'm having trouble getting my head around what it's about as what VNC is, is a mystery to me), that's kind of the problem here.










share|improve this question























  • What about the TTY you're on? Is it running agetty?
    – muru
    Aug 13 at 8:54










  • I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
    – Brenton Horne
    Aug 13 at 8:57







  • 1




    Potential answerers may be interested in askubuntu.com/questions/54814 .
    – JdeBP
    Aug 13 at 9:03






  • 1




    Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
    – muru
    Aug 13 at 9:07






  • 1




    It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
    – JdeBP
    Aug 13 at 9:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite











In my QEMU virtual machine (started with qemu-kvm -boot d arch-freebsd.img -m 4096) I'd like to access an agetty terminal, which I'd normally access with Ctrl+Alt+F2 (or F3 if I need tty3, F4 if tty4, etc.), unfortunately pressing these keys just merely changes me to an agetty terminal on my host (as opposed to the guest system I'm trying to go to tty2 in). If this were a VirtualBox VM I'd press Ctrl+F2 (specifically the Ctrl in the centre of my keyboard, i.e. my right Ctrl key) to access tty2, but this doesn't work with QEMU. If you suggest I press Ctrl+Alt+G to get the VM to grab all my keyboard and mouse inputs, then pressing the keys to access the agetty terminals I've tried doing that and it doesn't work.



EDIT: The proposed duplicate link doesn't list what solved my problem, pressing Alt+Fx. I've tried Ctrl+Alt+Fx that seems to be suggested there (although I'm having trouble getting my head around what it's about as what VNC is, is a mystery to me), that's kind of the problem here.










share|improve this question















In my QEMU virtual machine (started with qemu-kvm -boot d arch-freebsd.img -m 4096) I'd like to access an agetty terminal, which I'd normally access with Ctrl+Alt+F2 (or F3 if I need tty3, F4 if tty4, etc.), unfortunately pressing these keys just merely changes me to an agetty terminal on my host (as opposed to the guest system I'm trying to go to tty2 in). If this were a VirtualBox VM I'd press Ctrl+F2 (specifically the Ctrl in the centre of my keyboard, i.e. my right Ctrl key) to access tty2, but this doesn't work with QEMU. If you suggest I press Ctrl+Alt+G to get the VM to grab all my keyboard and mouse inputs, then pressing the keys to access the agetty terminals I've tried doing that and it doesn't work.



EDIT: The proposed duplicate link doesn't list what solved my problem, pressing Alt+Fx. I've tried Ctrl+Alt+Fx that seems to be suggested there (although I'm having trouble getting my head around what it's about as what VNC is, is a mystery to me), that's kind of the problem here.







freebsd keyboard-shortcuts qemu agetty






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 13 at 9:15

























asked Aug 13 at 8:19









Brenton Horne

1,34932144




1,34932144











  • What about the TTY you're on? Is it running agetty?
    – muru
    Aug 13 at 8:54










  • I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
    – Brenton Horne
    Aug 13 at 8:57







  • 1




    Potential answerers may be interested in askubuntu.com/questions/54814 .
    – JdeBP
    Aug 13 at 9:03






  • 1




    Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
    – muru
    Aug 13 at 9:07






  • 1




    It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
    – JdeBP
    Aug 13 at 9:12
















  • What about the TTY you're on? Is it running agetty?
    – muru
    Aug 13 at 8:54










  • I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
    – Brenton Horne
    Aug 13 at 8:57







  • 1




    Potential answerers may be interested in askubuntu.com/questions/54814 .
    – JdeBP
    Aug 13 at 9:03






  • 1




    Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
    – muru
    Aug 13 at 9:07






  • 1




    It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
    – JdeBP
    Aug 13 at 9:12















What about the TTY you're on? Is it running agetty?
– muru
Aug 13 at 8:54




What about the TTY you're on? Is it running agetty?
– muru
Aug 13 at 8:54












I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
– Brenton Horne
Aug 13 at 8:57





I believe so. Does FreeBSD do so by default? If so yes. If not, no. I've tried this with Linux VMs too, with the same problem.
– Brenton Horne
Aug 13 at 8:57





1




1




Potential answerers may be interested in askubuntu.com/questions/54814 .
– JdeBP
Aug 13 at 9:03




Potential answerers may be interested in askubuntu.com/questions/54814 .
– JdeBP
Aug 13 at 9:03




1




1




Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
– muru
Aug 13 at 9:07




Possible duplicate of VNC send Ctrl+Alt+F1-F6 to server
– muru
Aug 13 at 9:07




1




1




It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
– JdeBP
Aug 13 at 9:12




It's generic VNC answers, muru, and doesn't list the QEMU monitor commands given in AskUbuntu. It is not agetty in FreeBSD, by the way BH2017. And the only chvt command on FreeBSD to my knowledge is the one that I wrote.
– JdeBP
Aug 13 at 9:12










1 Answer
1






active

oldest

votes

















up vote
1
down vote














I'd like to access an agetty terminal, which I'd normally access with ⎈ Control+⎇ Alt+F2




There are two errors in that, one of which points to an answer, one of several possible answers.



The first error is that FreeBSD does not have Wietse Venema's agetty ("alternative getty"). It has ordinary BSD getty. So that nomenclature is wrong. Indeed, there is not necessarily a getty running on every kernel virtual terminal, that depending from what is configured in /etc/ttys.



The second error is that one normally accesses the multiple kernel virtual terminals with just plain ⎇ Alt and a function key on FreeBSD. The ⎈ Control is superfluous, and only necessary when an X server is in the foreground. X servers only recognize chords that have both ⎈ Control+⎇ Alt, but the keyboard mappings given to kernel itself, which is what handles this when an X server is not in the foreground, only actually require ⎇ Alt, just as they did on SCO Multiscreen (where this originated):



% sed -n -e '1,4p;/ 068 /p' /usr/share/vt/keymaps/uk.kbd
# $FreeBSD$
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
%


Of course, one can send a ⎈ Control+⎇ Alt chord to the guest operating system, and there are two ways of doing this:



  • Turn on sticky keys in the guest. Use sticky keys to stick the ⎈ Control modifier down, and then press ⎇ Alt+F2. Sticky keys support is a GUI thing, note. This will not help if a GUI session is not in the foreground.

  • Switch to the QEMU Monitor Console, and use the sendkey command. That can send a wide range of chords to the guest operating system. In this particular case it would be sendkey ctrl-alt-f2. Then switch back from the monitor console, of course.

Ubuntu users, including muru here, have suggested the chvt command. That's Linux-think. There is no chvt command in FreeBSD. I wrote one, and provide it in the nosh toolset; but the operating system does not come with one out of the box.



My chvt is primarily for use with user-space virtual terminals, and defaults to head0, but it can handle the kernel virtual terminals as well. One would for this purpose invoke it (assuming that one has the privileges to access /dev/ttyv0) as:



chvt 1@ttyv0


The tool supplied out of the box is vidcontrol, which for this particular task one would invoke (assuming that one has the privileges to access /dev/ttyv0) as:



vidcontrol -s 2 < /dev/ttyv0


Further reading



  • "Monitor". QEMU. Wikibooks.

  • Jonathan de Boyne Pollard (2018). chvt. nosh Guide. Softwares.

  • Soren Schmidt, Sascha Wildner, et al. (2016-01-19). vidcontrol FreeBSD General Commands Manual. freebsd.org.

  • What is the difference between getty and agetty?





share|improve this answer




















  • I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
    – Brenton Horne
    Aug 13 at 11:27










  • I didn't miss it. Read carefully. (-:
    – JdeBP
    Aug 13 at 11:31










  • > switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
    – Brenton Horne
    Aug 13 at 11:36











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462238%2fhow-to-access-agetty-terminals-e-g-tty2-3-4-etc-from-qemu-vm%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote














I'd like to access an agetty terminal, which I'd normally access with ⎈ Control+⎇ Alt+F2




There are two errors in that, one of which points to an answer, one of several possible answers.



The first error is that FreeBSD does not have Wietse Venema's agetty ("alternative getty"). It has ordinary BSD getty. So that nomenclature is wrong. Indeed, there is not necessarily a getty running on every kernel virtual terminal, that depending from what is configured in /etc/ttys.



The second error is that one normally accesses the multiple kernel virtual terminals with just plain ⎇ Alt and a function key on FreeBSD. The ⎈ Control is superfluous, and only necessary when an X server is in the foreground. X servers only recognize chords that have both ⎈ Control+⎇ Alt, but the keyboard mappings given to kernel itself, which is what handles this when an X server is not in the foreground, only actually require ⎇ Alt, just as they did on SCO Multiscreen (where this originated):



% sed -n -e '1,4p;/ 068 /p' /usr/share/vt/keymaps/uk.kbd
# $FreeBSD$
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
%


Of course, one can send a ⎈ Control+⎇ Alt chord to the guest operating system, and there are two ways of doing this:



  • Turn on sticky keys in the guest. Use sticky keys to stick the ⎈ Control modifier down, and then press ⎇ Alt+F2. Sticky keys support is a GUI thing, note. This will not help if a GUI session is not in the foreground.

  • Switch to the QEMU Monitor Console, and use the sendkey command. That can send a wide range of chords to the guest operating system. In this particular case it would be sendkey ctrl-alt-f2. Then switch back from the monitor console, of course.

Ubuntu users, including muru here, have suggested the chvt command. That's Linux-think. There is no chvt command in FreeBSD. I wrote one, and provide it in the nosh toolset; but the operating system does not come with one out of the box.



My chvt is primarily for use with user-space virtual terminals, and defaults to head0, but it can handle the kernel virtual terminals as well. One would for this purpose invoke it (assuming that one has the privileges to access /dev/ttyv0) as:



chvt 1@ttyv0


The tool supplied out of the box is vidcontrol, which for this particular task one would invoke (assuming that one has the privileges to access /dev/ttyv0) as:



vidcontrol -s 2 < /dev/ttyv0


Further reading



  • "Monitor". QEMU. Wikibooks.

  • Jonathan de Boyne Pollard (2018). chvt. nosh Guide. Softwares.

  • Soren Schmidt, Sascha Wildner, et al. (2016-01-19). vidcontrol FreeBSD General Commands Manual. freebsd.org.

  • What is the difference between getty and agetty?





share|improve this answer




















  • I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
    – Brenton Horne
    Aug 13 at 11:27










  • I didn't miss it. Read carefully. (-:
    – JdeBP
    Aug 13 at 11:31










  • > switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
    – Brenton Horne
    Aug 13 at 11:36















up vote
1
down vote














I'd like to access an agetty terminal, which I'd normally access with ⎈ Control+⎇ Alt+F2




There are two errors in that, one of which points to an answer, one of several possible answers.



The first error is that FreeBSD does not have Wietse Venema's agetty ("alternative getty"). It has ordinary BSD getty. So that nomenclature is wrong. Indeed, there is not necessarily a getty running on every kernel virtual terminal, that depending from what is configured in /etc/ttys.



The second error is that one normally accesses the multiple kernel virtual terminals with just plain ⎇ Alt and a function key on FreeBSD. The ⎈ Control is superfluous, and only necessary when an X server is in the foreground. X servers only recognize chords that have both ⎈ Control+⎇ Alt, but the keyboard mappings given to kernel itself, which is what handles this when an X server is not in the foreground, only actually require ⎇ Alt, just as they did on SCO Multiscreen (where this originated):



% sed -n -e '1,4p;/ 068 /p' /usr/share/vt/keymaps/uk.kbd
# $FreeBSD$
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
%


Of course, one can send a ⎈ Control+⎇ Alt chord to the guest operating system, and there are two ways of doing this:



  • Turn on sticky keys in the guest. Use sticky keys to stick the ⎈ Control modifier down, and then press ⎇ Alt+F2. Sticky keys support is a GUI thing, note. This will not help if a GUI session is not in the foreground.

  • Switch to the QEMU Monitor Console, and use the sendkey command. That can send a wide range of chords to the guest operating system. In this particular case it would be sendkey ctrl-alt-f2. Then switch back from the monitor console, of course.

Ubuntu users, including muru here, have suggested the chvt command. That's Linux-think. There is no chvt command in FreeBSD. I wrote one, and provide it in the nosh toolset; but the operating system does not come with one out of the box.



My chvt is primarily for use with user-space virtual terminals, and defaults to head0, but it can handle the kernel virtual terminals as well. One would for this purpose invoke it (assuming that one has the privileges to access /dev/ttyv0) as:



chvt 1@ttyv0


The tool supplied out of the box is vidcontrol, which for this particular task one would invoke (assuming that one has the privileges to access /dev/ttyv0) as:



vidcontrol -s 2 < /dev/ttyv0


Further reading



  • "Monitor". QEMU. Wikibooks.

  • Jonathan de Boyne Pollard (2018). chvt. nosh Guide. Softwares.

  • Soren Schmidt, Sascha Wildner, et al. (2016-01-19). vidcontrol FreeBSD General Commands Manual. freebsd.org.

  • What is the difference between getty and agetty?





share|improve this answer




















  • I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
    – Brenton Horne
    Aug 13 at 11:27










  • I didn't miss it. Read carefully. (-:
    – JdeBP
    Aug 13 at 11:31










  • > switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
    – Brenton Horne
    Aug 13 at 11:36













up vote
1
down vote










up vote
1
down vote










I'd like to access an agetty terminal, which I'd normally access with ⎈ Control+⎇ Alt+F2




There are two errors in that, one of which points to an answer, one of several possible answers.



The first error is that FreeBSD does not have Wietse Venema's agetty ("alternative getty"). It has ordinary BSD getty. So that nomenclature is wrong. Indeed, there is not necessarily a getty running on every kernel virtual terminal, that depending from what is configured in /etc/ttys.



The second error is that one normally accesses the multiple kernel virtual terminals with just plain ⎇ Alt and a function key on FreeBSD. The ⎈ Control is superfluous, and only necessary when an X server is in the foreground. X servers only recognize chords that have both ⎈ Control+⎇ Alt, but the keyboard mappings given to kernel itself, which is what handles this when an X server is not in the foreground, only actually require ⎇ Alt, just as they did on SCO Multiscreen (where this originated):



% sed -n -e '1,4p;/ 068 /p' /usr/share/vt/keymaps/uk.kbd
# $FreeBSD$
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
%


Of course, one can send a ⎈ Control+⎇ Alt chord to the guest operating system, and there are two ways of doing this:



  • Turn on sticky keys in the guest. Use sticky keys to stick the ⎈ Control modifier down, and then press ⎇ Alt+F2. Sticky keys support is a GUI thing, note. This will not help if a GUI session is not in the foreground.

  • Switch to the QEMU Monitor Console, and use the sendkey command. That can send a wide range of chords to the guest operating system. In this particular case it would be sendkey ctrl-alt-f2. Then switch back from the monitor console, of course.

Ubuntu users, including muru here, have suggested the chvt command. That's Linux-think. There is no chvt command in FreeBSD. I wrote one, and provide it in the nosh toolset; but the operating system does not come with one out of the box.



My chvt is primarily for use with user-space virtual terminals, and defaults to head0, but it can handle the kernel virtual terminals as well. One would for this purpose invoke it (assuming that one has the privileges to access /dev/ttyv0) as:



chvt 1@ttyv0


The tool supplied out of the box is vidcontrol, which for this particular task one would invoke (assuming that one has the privileges to access /dev/ttyv0) as:



vidcontrol -s 2 < /dev/ttyv0


Further reading



  • "Monitor". QEMU. Wikibooks.

  • Jonathan de Boyne Pollard (2018). chvt. nosh Guide. Softwares.

  • Soren Schmidt, Sascha Wildner, et al. (2016-01-19). vidcontrol FreeBSD General Commands Manual. freebsd.org.

  • What is the difference between getty and agetty?





share|improve this answer













I'd like to access an agetty terminal, which I'd normally access with ⎈ Control+⎇ Alt+F2




There are two errors in that, one of which points to an answer, one of several possible answers.



The first error is that FreeBSD does not have Wietse Venema's agetty ("alternative getty"). It has ordinary BSD getty. So that nomenclature is wrong. Indeed, there is not necessarily a getty running on every kernel virtual terminal, that depending from what is configured in /etc/ttys.



The second error is that one normally accesses the multiple kernel virtual terminals with just plain ⎇ Alt and a function key on FreeBSD. The ⎈ Control is superfluous, and only necessary when an X server is in the foreground. X servers only recognize chords that have both ⎈ Control+⎇ Alt, but the keyboard mappings given to kernel itself, which is what handles this when an X server is not in the foreground, only actually require ⎇ Alt, just as they did on SCO Multiscreen (where this originated):



% sed -n -e '1,4p;/ 068 /p' /usr/share/vt/keymaps/uk.kbd
# $FreeBSD$
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
%


Of course, one can send a ⎈ Control+⎇ Alt chord to the guest operating system, and there are two ways of doing this:



  • Turn on sticky keys in the guest. Use sticky keys to stick the ⎈ Control modifier down, and then press ⎇ Alt+F2. Sticky keys support is a GUI thing, note. This will not help if a GUI session is not in the foreground.

  • Switch to the QEMU Monitor Console, and use the sendkey command. That can send a wide range of chords to the guest operating system. In this particular case it would be sendkey ctrl-alt-f2. Then switch back from the monitor console, of course.

Ubuntu users, including muru here, have suggested the chvt command. That's Linux-think. There is no chvt command in FreeBSD. I wrote one, and provide it in the nosh toolset; but the operating system does not come with one out of the box.



My chvt is primarily for use with user-space virtual terminals, and defaults to head0, but it can handle the kernel virtual terminals as well. One would for this purpose invoke it (assuming that one has the privileges to access /dev/ttyv0) as:



chvt 1@ttyv0


The tool supplied out of the box is vidcontrol, which for this particular task one would invoke (assuming that one has the privileges to access /dev/ttyv0) as:



vidcontrol -s 2 < /dev/ttyv0


Further reading



  • "Monitor". QEMU. Wikibooks.

  • Jonathan de Boyne Pollard (2018). chvt. nosh Guide. Softwares.

  • Soren Schmidt, Sascha Wildner, et al. (2016-01-19). vidcontrol FreeBSD General Commands Manual. freebsd.org.

  • What is the difference between getty and agetty?






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 13 at 11:16









JdeBP

29.3k460136




29.3k460136











  • I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
    – Brenton Horne
    Aug 13 at 11:27










  • I didn't miss it. Read carefully. (-:
    – JdeBP
    Aug 13 at 11:31










  • > switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
    – Brenton Horne
    Aug 13 at 11:36

















  • I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
    – Brenton Horne
    Aug 13 at 11:27










  • I didn't miss it. Read carefully. (-:
    – JdeBP
    Aug 13 at 11:31










  • > switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
    – Brenton Horne
    Aug 13 at 11:36
















I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
– Brenton Horne
Aug 13 at 11:27




I noticed you missed the fact that sendkey ctrl-alt-f2 isn't working for PCLinuxOS, a Linux distro, I just get a black screen (no line cursor, no login prompt, nothing). I thought I mentioned it in the comments above, but apparently not. I tried it from the supposed duplicate answer and I experience this issue.
– Brenton Horne
Aug 13 at 11:27












I didn't miss it. Read carefully. (-:
– JdeBP
Aug 13 at 11:31




I didn't miss it. Read carefully. (-:
– JdeBP
Aug 13 at 11:31












> switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
– Brenton Horne
Aug 13 at 11:36





> switch back from the monitor console What the ... does that mean? I ignored it as I didn't get what it meant. Ctrl-Alt-2 (what got me there) doesn't switch me back.
– Brenton Horne
Aug 13 at 11:36


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462238%2fhow-to-access-agetty-terminals-e-g-tty2-3-4-etc-from-qemu-vm%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)