VM connection refused

Hello, i have a problem.

I have on my server 2 VM’s wich always that it goes down i just mout it on again and give it a virsh start to it run, I use to login in these vms using ssh and there ip after i mount it up.

But i got an error it says that port 22 no host to host

My server is connected in internet, can please someone help me with that?

I use to run my vms always like that:

mount /dev/sda3 /srvdthwas02

mount /dev/sda4 /srvdthdb02

virsh start srvdthwas02

virsh start srvdthdb01

Today when i was executing these commands when i gave the comand virsh start in both vmthe system gave me the warnning: no socket to connect to.
And i dont know why

Can some one explain me please?

Are you <sure> you are quoting the error exactly?
There are a number of possible socket related errors, but the <exact> error message is needed to troubleshoot accurately.

In any case,
Make sure your libvirt daemon is running one way to return current status is

systemctl status libvirtd.service

TSU

Its better to see this to you understand.

http://postimg.org/image/5v0po8l75/||
|—|

It looks to me that you haven’t configured your Guest’s network settings correctly.
The important error which is the basis for your problem and other errors is “no route to host” which essentially means that your network configuration is invalid.
In fact, if I were to guess, you probably tried to configure your Guest to use your physical interface instead of creating and using a Linux Bridge Device, and the error relates to conflicts between your Host and Guest trying to use the same network sockets.

If you are relatively new to virtualization, is there a reason why you’re not running a graphical Desktop?
For many people, the graphical tools like virt-manager and virt-install guide you through creating, configuration and managing a Guest correctly. You won’t be guided when you use the command line.

If you want to minimize the resources used by a Graphical Desktop, you can install Minimal-X which for the most part uses almost no additional resources compared to running in text mode as you seem to be doing now, but you can install and use graphical tools.

If you really want to continue with what you have now,
You need to post your Guest configuration file, or the parameters you passed when launching your Guest.

TSU

Everytime that i need i do the same procedure and always works, but now it is not working.

These vm’s is working for so long, i didn’t created them, i just verify if it still working and try to resolve this kind of problems to keep working, but this time it gave me this error and the guy who created it once is not working here anymore, could you help me with that?

This problem happend after a blackout here. It Happend some time ago as well but the procedure worked fine. Just not this time.

telnet is also not working :frowning:

No one can help you unless we understand what you have set up.
As I described, my initial guess is that whoever set up your machines did it incorrectly so set you off on a path where there are no easy answers.

But, as I also said if you have no wish to properly fix your problem(if it’s what I think it is) then you’ll have to at least provide the information I requested (your Guest config file).

TSU

Im sorry, I dont use to work with that for so long, is there some archieve like this /etc/hosts into linux machine to describe how are my vm’s configured? Something like that? I get the info about the archieve /etc/hosts and how is the configuration of the networks here. The vm’s i cant access cuz telnet is not working. dont know why

/etc/hosts

ifconfig -a

You have to start by stating what virtualization you’re running.

Virsh is the command line tool that’s associated with libvirt, but libvirt can be used to manage practically every type of virtualization (on openSUSE, it’s primarily set up to manage KVM, Xen and LXC).

From that, you can more or less find the relevant documentation.

Although there are many inaccuracies in the current community openSUSE virtualization documentation (IMO), you might find what you’re looking for here
https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/index.html

More speciifically here
https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha.kvm.inst.html#sec.libvirt.inst.advanced

But, the above link makes several suppositions. At least though, you’ll hopefully be on the right track to find your storage location.

TSU

Im on primary machine, these configs is from primary, when o try connect into a VM anyone, It doesnt work.
[telnet by ip and name] http://postimg.org/image/kjuek9qlh/

From what you have posted,
It looks like you are sitting at, and logging in locally to the HostOS.

If that is true, then the next step is to browse to the locations in your HostOS that contain your VMs, and likely within a folder holding the Guest files you will find a file that is the configuration or definition file.

Yes, you can’t logon into your Guest, that’s understood but is not what is being requested…
We don’t want anything that might be configured <inside> the Guest,
We want the file that describes how the libvirt app running on the Host sets up the Guest.

TSU

There it goes

https://postimg.org/image/sabbv06op/
https://postimg.org/image/859qab6yh/

I have a question.
I have in each vm an different ip. I defined each one into a vm. Should i define the ips into primary aswell for the doors or I dont need to do anything more in primary after i did into vms?

Look, this should be right even after a blackout, but maybe after this it might unconfigured. But im not sure how was the doors before.

I rebooted my server again to see. And I had mounted my vms and had a look into the ifconfig and there was not any doors called net0 and net1.
Then I started the vm by virsh and these doors appeared into ifconfig. Is this the right behave from the server?

Please! I still need help

Before your situation is discussed further,
You should know that although taking photographs and posting is OK if they’re clear enough, it’s preferable to copy the file to where the file can be read from a machine with a GUI.

So, as an example since I have a github account, I would create a special repo in github for misc postings, upload the file to that repo, then from a machine like the one you’re likely reading this post open the file on github and paste the contents into your Forum post.

If you don’t have a github account, it’s a bit trickier because authentication issues aren’t so easy to set up but you can use private Cloud storage.

Or, if these are two machines in your same network, then you can scp (easiest) or set up a tftp, ftp or http server stub for transferring files.


Now,

First, it looks like your two Guests are configured using bridge devices instead of connecting directly to physical adapters, but possibly incorrectly.

Is there some reason why you configured each of your two machines using different bridge devices?

By default, when br0 is created, it’s a bridge device <also configured as a bridging device>.
That might sound confusing, but what it means is that any Guest that uses br0 should behave like any other Host <directly connected> to the physical network, so some things you’d expect to see is that if there is a DHCP server on your physical network, your Guest using br0 can be a DHCP client and be assigned network settings from the DHCP server. If you manually create static IP addresses and network settings, they should use the same networkID as the HostOS and other physical machines on the network.

Your second Guest however is configured to use a different bridging device (br1) for some reason. You need to display or describe the features of br1 to know how to configure any machine using this bridge device, in particular if it is enables NAT or Host-Only networking.

If you intend to use Guest 2 as machine on the same network as everyone else, you should configure it to use br0 like the first Guest.

Although it’s possible to display some characteristics of br0 using the brctl utility, it’s probably easier to inspect it by running YAST.

From your console, elevate your permissions (su or sudo) and type

yast

From there, use your keyboard to navigate Network Settings, select your network device of choice and explore or edit. Using this same tool you should be able to view your br0 and br1, and also edit your network interface if you wish (less mistakes than editing the interface files directly).

Keep in mind that what you’re seeing in YAST is the network settings <from within> of the HostOS or Guest.
The photos you posted are not the same thing, those are the <environments> the HostOS is presenting “from the outside” to each Guest.

Bottom line…
I’m guessing that both your Guests should be using br0 for their network connection
Each should be verified configuring IP addresses and settings that are valid on your physical network.

If you have problems configuring that, post again.

TSU

Alright, I just access my root in the physical machine, cuz i didn’t gave permission to access root outside, just the vms has this permission. I use own machine to comunicate with the forum, cuz the server is inside the lab and there is no place to sit and there is cold. =P

========================================================================================

About the machines.
The first vm is where i put my app, it has a hot ip to access the aplication and send data to it can process and save into database and also has a apache to show this info in graphs and numbers.
The other VM is accessable only in the company, it is a database of the application, just to keep safe the data.

OK,
So, it seems that the 2 VMs are configured to use different virtual networks which explains at least in part why each is configured with a different bridge device.

So, now that you have local access to the HostOS,
Can you remote into each of your Guests (SSH, VNC, remote X, etc), from within each machine you should run typical network troubleshooting procedures (ping IP address, ping name, probe ports) to verify network functionality? If you can verify basic networking is working, then you can turn your attention to any applications which might not be working correctly.

TSU

Tsu,
The vm’s lost there conf of network. I accessed the virtual manager and there root and saw that both was empty, Then I configurated again and it go back to work. :slight_smile:
Thank u so much for your help

Great!
Always like to hear a success story, congrats on figuring it out.

TSU