[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but stil
From: |
Thomas Huth |
Subject: |
Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest? |
Date: |
Tue, 10 Apr 2018 22:54:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 10.04.2018 16:06, Ciro Santilli wrote:
> On Tue, Apr 10, 2018 at 6:27 AM, Thomas Huth <address@hidden> wrote:
>> On 10.04.2018 02:10, Ciro Santilli wrote:
>>> On Mon, Apr 9, 2018 at 1:33 PM, Thomas Huth <address@hidden> wrote:
>>>> On 08.04.2018 12:39, Ciro Santilli wrote:
>> [...]
>>>>> Is there a way to both keep my `Ctrl-C` and `-monitor` working with
>>>>> `-nographic`?
>>>>>
>>>>> Full QEMU command:
>>>>>
>>>>> qemu-system-x86_64 -append 'root=/dev/vda console=ttyS0' -kernel
>>>>> 'bzImage' -drive file='rootfs.ext2.qcow2,if=virtio,format=qcow2'
>>>>> -nographic -monitor telnet::45454,server,nowait
>>>>
>>>> I think you need a chardev with signal=off for that. Try something like:
>>>>
>>>> qemu-system-x86_64 -nographic -monitor telnet::45454,server,nowait \
>>>> -chardev stdio,id=s1,signal=off \
>>>> -serial none -device isa-serial,chardev=s1
>>>>
>>>
>>> I tried that and Ctrl+C does get passed to the guest as I wanted.
>>>
>>> However, when I do this, I noticed that I can't pass Ctrl+A X to
>>> easily quit QEMU (I know I can do quit on the monitor).
>>>
>>> Is there a way to also keep Ctrl+A X working, in addition to having
>>> Ctrl+C passed to the guest?
>>
>> Yes, you need to multiplex the stdio output with a HMP monitor:
>>
>> qemu-system-x86_64 -nographic -monitor telnet::45454,server,nowait \
>> -chardev stdio,id=s1,signal=off,mux=on -serial none \
>> -device isa-serial,chardev=s1 -mon chardev=s1,mode=readline
>>
>
> Thanks, that worked perfectly!
>
> Do you know how to do the same thing for `qemu-system-arm -M
> versatilepb` or `qemu-system-aarch64 -M virt`?
Not sure ... at least versatilepb seems to use an embedded UART, so
-device likely does not work there.
But you could try to simply use "-serial mon:stdio" here. Actually, now
that I remembered that option ... that might even also work on x86
instead of all that complicated stuff that I told you before:
qemu-system-x86_64 -nographic -monitor telnet::45454,server,nowait \
-serial mon:stdio
(I initially didn't know that you also wanted to have a HMP monitor /
Ctrl-A X here, too, that's why I did not think of this solution in my
first mail)
HTH,
Thomas
- [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Ciro Santilli, 2018/04/08
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Thomas Huth, 2018/04/09
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Ciro Santilli, 2018/04/09
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Thomas Huth, 2018/04/10
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Ciro Santilli, 2018/04/10
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?,
Thomas Huth <=
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Ciro Santilli, 2018/04/11
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Peter Maydell, 2018/04/11
- Re: [Qemu-discuss] How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest?, Ciro Santilli, 2018/04/11