Guest open Named Pipe on Host?
Guest open Named Pipe on Host?
I have two apps which communicate over a named pipe (Unix domain socket) - all on one machine. I cannot figure out how to get the app in the VirtualBox VM (Linux) to open the named pipe on the host (Centos7).
I have mounted the shared folder so the Linux VM can see the shared folder containing the named pipe "file". But when it tries to connect to it, it gets ECONNREFUSED (no one listening).
The only thing I could see in the VirtualBox Manager was a section on setting Serial Ports to point to named pipes. But I want my app in the VM to connect to the actual named pipe, not COM1.
Is this possible?
I have mounted the shared folder so the Linux VM can see the shared folder containing the named pipe "file". But when it tries to connect to it, it gets ECONNREFUSED (no one listening).
The only thing I could see in the VirtualBox Manager was a section on setting Serial Ports to point to named pipes. But I want my app in the VM to connect to the actual named pipe, not COM1.
Is this possible?
-
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Guest open Named Pipe on Host?
Question: Can you achieve this with a network connection? Shared folders are a limited subset and do not have a lot of functionality other than transferring files.
Re: Guest open Named Pipe on Host?
I actually need the named pipe (domain socket) because the Host app is creating a file and passing its handle back to the Guest app. This is because the Guest app doesn't have permission to create the file.
-
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Guest open Named Pipe on Host?
Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: Guest open Named Pipe on Host?
VirtualBox is primarily a hardware emulator: if what you want cannot be achieved at a hardware level then it cannot be done (unless the GAs provide something). VirtualBox can access a named pipe on the host and make this available as a hardware emulation to the guest. E.g. the serial port feature you've already seen.
So, do the GAs provide something? Possibly they could provide a feature, but I'm not aware that they do at present. In fact I'm not at all sure how easily it could be done, given that the VM would have to somehow sense when a new pipe server is advertised on the host, i.e. the VM would have to be able to sense host activity, which IMO is both contrary to VM principles and probably costly in CPU terms.
As Perry has already done, I suggest that you look for a network feature which does what you want, something similar to UPnP. Any such networking feature will be a feature (or not) of the host and guest OS's, all VirtualBox will do is provide the network "hardware".
So, do the GAs provide something? Possibly they could provide a feature, but I'm not aware that they do at present. In fact I'm not at all sure how easily it could be done, given that the VM would have to somehow sense when a new pipe server is advertised on the host, i.e. the VM would have to be able to sense host activity, which IMO is both contrary to VM principles and probably costly in CPU terms.
As Perry has already done, I suggest that you look for a network feature which does what you want, something similar to UPnP. Any such networking feature will be a feature (or not) of the host and guest OS's, all VirtualBox will do is provide the network "hardware".
Re: Guest open Named Pipe on Host?
Well, just in case, I'm posting the vbox log file, as requested.
If it turns out this is impossible (sharing a named pipe), then of course I'll have to explore other options. The named pipe mechanism works with Docker containers and Docker hosts -- I was hoping the same would be true here with Virtualbox, and that I was just missing the magic setup.
Thanks,
-Dave
If it turns out this is impossible (sharing a named pipe), then of course I'll have to explore other options. The named pipe mechanism works with Docker containers and Docker hosts -- I was hoping the same would be true here with Virtualbox, and that I was just missing the magic setup.
Thanks,
-Dave
- Attachments
-
- vbox.log
- (67.11 KiB) Downloaded 22 times
-
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Guest open Named Pipe on Host?
It appears you are running this all nested in VMware, is that correct? If so that may also add a level of complexity that could prevent this from actually working. Nesting is very difficult.
Since you are using automount did you add your user name to the vboxsf group in the guest and reboot?
Code: Select all
DMI Product Name: VMware Virtual Platform
Code: Select all
Host path '/opt/Panorama', map name 'Panorama', writable, automount=true, create_symlinks=false, missing=false
SharedFolders host service: Adding host mapping
Host path '/home', map name 'hosthome', writable, automount=true, create_symlinks=true, missing=false
Re: Guest open Named Pipe on Host?
Guest app is running as root. The named pipe is created by the app running on the Host -- which indeed is inside the VMware guest. We do all our work inside of VMware guests without any issues.
I don't own the VirtualBox image. And it resets on shutdown. So, I run this command in the Guest after the Virtualbox image starts up:
mount -t vboxsf Panorama /opt/Panorama
After I do that, the directory and its contents are visible in the Guest.
I don't own the VirtualBox image. And it resets on shutdown. So, I run this command in the Guest after the Virtualbox image starts up:
mount -t vboxsf Panorama /opt/Panorama
After I do that, the directory and its contents are visible in the Guest.
-
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Guest open Named Pipe on Host?
In that case I would run the mount statement with the options switch to allow you to own the share in time.
Code: Select all
-o rw,uid=****,gid=****
Re: Guest open Named Pipe on Host?
I tried mount -t vboxsf -o rw,uid=1000,gid=1000 Panorama /opt/Panorama but it made no difference
-
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Guest open Named Pipe on Host?
That's all I got I am afraid. Nesting, and using shared folders to achieve a pipe connection is probably more than the host/guest communication can handle.
Re: Guest open Named Pipe on Host?
I think you're right. Thanks for your suggestions, though.
Re: Guest open Named Pipe on Host?
Hi,
just would like to add. I have tried that named pipe as Routing to Serial port on
Host(Virtual Guest)
1.Windows(Windwows)
2.Mac(Linux)
3.Linux(Linux)
In general the Virtual guest can connect to the com port and send data.
Also the host can recieve that data in some terminal program
But so far I was only able to send back data on the Windows(Windows) combination. Which was also not very stable thought
Also starting windows guests two times worked fine connecting through Serial ports over named pipes
However I would appriciate a lot some update would Support better Name Pipe connections
just would like to add. I have tried that named pipe as Routing to Serial port on
Host(Virtual Guest)
1.Windows(Windwows)
2.Mac(Linux)
3.Linux(Linux)
In general the Virtual guest can connect to the com port and send data.
Also the host can recieve that data in some terminal program
But so far I was only able to send back data on the Windows(Windows) combination. Which was also not very stable thought
Also starting windows guests two times worked fine connecting through Serial ports over named pipes
However I would appriciate a lot some update would Support better Name Pipe connections