Allowing an outgoing connection from Dom0

Hi folks,

Trying to get a tunnel or connection into a VM from Dom0.

I know you can do a connection from a Qube into Dom0, but I want to be able to get a connction out to one of the guests.

What is the best way to achieve this please?

So I have to get the guest to establish the connection to Dom0 and set up a tunnel? Or is there a way that is already set up in Qubes to allow this?

Hope you can help.

Sincerely,
A.

What exactly do you want to do with this connection?
Maybe qvm-run will be enough?

1 Like

No, needs to give Dom0 a connection on a port to the guest itself. Just a pipe between the two essentially.

I am currently trying to get the Dom0 Remote Session working to trial that to see if that methodology will function the way Iā€™m hoping.

But that isnā€™t seeming to work eitherā€¦ Canā€™t get it to work properly at leastā€¦

And yes, it would be easier if I could connect Dom0 to a networking VM. Then I could at least have it working easily along with as much protection as I want. So it would only be 1 port open for 1 IP addressā€¦

I donā€™t see much of an issue there.

You can connect to your qube with qvm-run, e.g.:
In your testqube run:

nc -l 12345

In dom0 run:

socat TCP-LISTEN:54321 EXEC:"qvm-run --pass-io testqube 'socat STDIO TCP:localhost:12345'"

In dom0 run:

nc localhost 54321

And you can see that the connection works.

1 Like

SOCAT says "exactly 2 addresses required (there are 3) "

Did you copy/type the command correctly? Double check it.
It works for me in Qubes OS 4.2.

I even created a new guest called ā€œtestqubeā€ for itā€¦ so yes.

Iā€™m running 4.1.1 (R4.1)

Whatā€™s your socat version in dom0?
socat -V

1.7.4.1

I still think that you have typo somewhere in the command. Maybe you have a space somewhere or missing quotes?

I have socat version 1.7.4.2 so it shouldnā€™t differ.

I have tried it EXACTLY the same and with the quotation marks and talks marks the opposite way around.

socat TCP-LISTEN:54321 EXEC:"qvm-run --pass-io testqube ā€˜socat STDIO TCP:localhost:12345ā€™ "

and

socat TCP-LISTEN:54321 EXEC:'qvm-run --pass-io testqube ā€œsocat STDIO TCP:localhost:12345ā€ ā€™

I ran a full update, and it still on Qubes 4.1

What if you try to run this command in dom0?

socat TCP-LISTEN:54321 EXEC:"nc -l 12345"

works fine

I canā€™t upgrade to Qubes 4.2, it wonā€™t install.

Installer says ā€œError setting up base repositoryā€ ā€¦

What would be the easist way to just set up a network pipe or attach Dom0 to a virtual network?