-
Notifications
You must be signed in to change notification settings - Fork 117
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
Replace the dummy console device by a true console device #978
Conversation
|
||
if FileManager.default.fileExists(atPath: consoleURL.absoluteURL.path()) == false { | ||
FileManager.default.createFile(atPath: consoleURL.absoluteURL.path(), contents: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that this won't create a socket, just a regular file 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a virtio socket not an unix domain socket.
It's not necessary to set some control flags like unix socket and if it will be necessary it will specified in the apple doc....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you use such a file then from the host?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below an example.
After it's possible to implement some protocoled agent like gRPC, http/https.....
it's a pipe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a pipe.
I'm sorry, but it's not a pipe. Nor a socket, which you call it in #978 (comment) and by giving it a .sock
extension.
It's a regular file stored on disk.
Moreover, you're using it for both for reading and writing, which will mess up the file contents badly if you'd ever want to implement any bidirectional communication on top of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, you're using it for both for reading and writing, which will mess up the file contents badly if you'd ever want to implement any bidirectional communication on top of it.
I don't see really the problem because it's a feature enabled by VZ. With a unix domain socket too you have the same problem.
You can write garbage to socket also, the effect is the same.
So it's could be replace by a tty...
Would you mind explaining your use-case a bit more in-depth, perhaps with some examples? Also, it generally feels like this should be an optional feature that is configured through a command-line argument, possibly allowing multiple console devices (or |
For example:
For concrete example take a look with lima-vm, multipass, lxd, incus...
It's not the same. The vz socket is only to communicate between VM and the hosting program hosting the VM. The socket is not available outside. With the console device:
on the host:
|
Do these solutions use VirtIO console device to communicate with the guest? Are they also using regular files on the host's side?
Why not use SSH for that? 🤔
Could you elaborate a bit on the inefficiency of querying the system's ARP table? But I agree that when using However, with the right setup it just works and is simple enough, compared to requiring the user to install the in-VM agent, supporting it, and teaching Tart to communicate with it properly. |
yes!
Agent is avalable earlier than network. and for macos VM you need to enable session sharing...
This is the big missing part of tart: you dropped cloud-init support for linux machine.... so i developed a tool using tart allowing to boot linux machine with cloud-init support enabled and many other features such as use qcow2 cloud images directly. |
I did replaced the regular file with a true socket. Take a look at console-devices-nio I did also extras implementation:
But I got some limitations.... |
Could you please point me to a file/code block in lima-vm/lima that implements agent communication via VirtIO console device?
Well, you still need to prepare the VM, either by:
As for the "earlier", have you measured the delay that the network bring-up causes, compared to communicating with the agent?
I don't get it. We use cloud-init on a daily basis in cirruslabs/linux-image-templates repository. In which commit/PR did we drop it?
Interesting! Is it published on GitHub? |
console device is special case of socket devices, could also use vsock if present. But on MacOS you don't vsock so the alternative is the console device. Else I start coded also the usage of VZVirtioSocketDevice with swift-nio. It's work fine, still to catch the remote close of socket by the guest, it miss a delegate method :)
Done thru cloud-init with cloud images but need to wait network fully configured... Sample user-data to create an Ubuntu desktop with tart and my tool.
Or already installed inside your OCI image. The faster boot
Is: Should be:
On GitHub but private repo until first release is ready Some usage:
|
Will be replaced by #985 |
The goal of this pull request is to replace the unusable dummy console device by a useful console device
In fact, the virtio socket is created in the guest machine but the host virtio socket is not created.
Now the console device is renamed tart-agent and the host socket file named tart-agent.sock is create inside the VM directory.
By this way, we can add some agent like incus or LXD to communicate between host and guest.