On Tue, Dec 06, 2022 at 05:57:19PM +0200, Vadim Likholetov wrote: > I’ve done this — I have patched cloud-hypervisor to have > three console devices — serial, console and user-console, but than > decided that this patches will never go to C-H mainline so got back > with more traditional approach with tmux :) I'd be pretty optimistic about the chances of a patch that just made it so you could provide multiple consoles the same way you can provide multiple block devices. Like "--console pty file=/path/to/console.out" on the command like to make two consoles, one going to a pty and the other to a file. In Spectrum, the way I'd see such an approach working is that by default there'd be a single console that gave you a shell inside the VM, and if you needed other consoles for other reasons (e.g. if you had an application running on the console, like Lynx) you'd configure another console in the VM configuration. But as we move more towards graphical applications, it will probably become rare to need a secondary console for application interaction like that. To get a non-root shell from the root console though, I think it should be enough to just: # s6-applyuidgid -u 1000 -g 1000 sh (Adding tmux to the VM in development to be able to hop between multiple shell sessions would be a reasonable thing to do, of course.) > > On 6 Dec 2022, at 17:20, Alyssa Ross wrote: > > > > On Mon, Dec 05, 2022 at 12:42:35AM +0200, Vadim Likholetov wrote: > >> Cloud-hypervisor has virtual hardware limitations -- it supports only one > >> console device and only one serial device. > >> SpectrumOS is using serial device for kernel logs of appVM and console > >> device as a console. > >> To have access both to root-executed part and to user-executed part of the > >> VM payload, I installed a tmux on console. > >> Now, when you're running vm-console command you get access to the tmux > >> and have the ability to switch between root and user consoles, > >> that can be useful during debugging VM payload. > > > > I wonder what it would take to make cloud-hypervisor support multiple > > virtio-console devices… I suspect it wouldn't be too hard, since it > > already supports multiples of every other virtio device just fine… > >