-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serial: Add --device virtio-serial,pty support #113
base: main
Are you sure you want to change the base?
Conversation
pkg/vf/virtionet.go uses local adhoc solution to run cleanup tasks when vfkit exits. github.com/onsi/gocleanup achieves the same result in more generic code. Since there are more things I'd like to cleanup at exit time, let's make use of this package. It hasn't been changed in a long time, but its code is a short single file, at worse we can import this file in vfkit repository and make the changes we need. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
When using the REST API over a unix socket, this ensures the unix socket is removed from the filesystem when vfkit exits.
This new virtio-serial option allocates a pseudo-tty for the VM console. It can then be accessed using `screen` for example. This is a bit similar to the `--device virtio-serial,stdio` option, except that the console is not tied to the terminal running vfkit, it's possible to connect/disconnect from the pseudo-tty from any terminal. This fixes crc-org#48 Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This uses more helper APIs from github.com/pkg/term/termios, and makes the code closer to Apple's recommendations in https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine?language=objc#:~:text=Configure%20the%20Serial%20Port%20Device%20for%20Standard%20In%20and%20Out This also removes direct use of `syscall` in pkg/vf/virtio.go Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
tested and working as expected..
after this i was able to see the fedora login prompt by running |
/lgtm |
I am testing it with crc bundle with the script part of contrib/script with following change but not able to get any login prompt
I will try with fedora also same what @anjannath tested and put another comment. |
To me even steps mentioned by @anjannath didn't work after |
You need to make sure you have |
I tried again and it is working for me still, maybe you have to attach to the pty quickly otherwise you miss the login prompt and it doesn't re-appear? pty.movbut another thing i noticed is that the keyboard only works sometimes, a few times (2 out of 4 runs) during testing keys are not echoed in screen, which i assumed to be the keyboard not working |
I also tried to attach pty quickly but still nothing, waiting more that 5 mins. |
So after 5-6 retry finally I am able to get the login prompt for fedora and crc bundle but then on crc I am not able to use the keyboard but on fedora able to do. |
Maybe virtio: Simplify setRawMode is causing issues. Or maybe it would be better to use https://github.com/pkg/term/blob/1a4a3b719465afccedae7788469c0b54a43417e0/termios/termios.go#L41-L50 , but I could not get this to work correctly. |
I am also not sure what causing the issue but as of now this functionality is quite buggy and we might not able to consume it when required like debugging an broken ssh connection. Do you think we can use |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This new virtio-serial option allocates a pseudo-tty for the VM console. It
can then be accessed using
screen
for example. This is a bit similar tothe
--device virtio-serial,stdio
option, except that the console is nottied to the terminal running vfkit, it's possible to connect/disconnect
from the pseudo-tty from any terminal.
This fixes #48