I use KVM a lot, but I never set it up myself and I also don’t know how to configure it. I’m just the “consumer” of KVM.
Therefore, I will talk from a VirtualBox perspective, and pretend the same knowledge applies here.
Maybe you need to open ports through the virtual machine’s configuration. E.g. in this case you would open inbound TCP 22.
Ping is overrated in the network world. Everyone says, just ping this, just ping that. But I say: no, don’t just ping. Make an actual TCP or UDP connection.
sudo apt install -y ncat
nc -vz 10.0.2.15 22
This way you can check, if the address is reachable through the TCP port 22 on the target.
Pings actually do not mean much. It’s quick and dirty, but not as reliable, as most people think. You can’t imagine how many people I have seen in my entire life, wasting hours of their precious time, trying to debug a connectivity issue by using Ping, just to find out, that Ping was telling them results, which were not correctly interpreted in the context of the situation. For example, it’s not uncommon for a server to block Ping packets, but let through other types of packets. So, if you try to debug connectivity issues with Ping, it may seem like you cannot connect to the host, even if the host is just blocking all the Ping packets, not other types of packets.
Check if SSH is properly running on the live medium.
Ironically, the developers wanted to make the output more understandable, by replacing common ports with names, that represent their meaning:
HTTP → 80 or 8080
HTTPS → 443
SSH → 22
etc…
Did you check, if you need to open ports for your virtual machine?
What about firejail? Maybe this is blocking access. If it’s a sandbox in the classic sense, it almost certainly should block access like the one you are trying to establish.
Firejail doesn´t seem to be the culprit. I ran the same kvm-command without invoking firejail in order to check but the result is the same. In every aspect.
Phew, I wish I could tell. No idea how to check that.
But after performing “sudo ocs-live-netcfg” in the VM I get the following message:
Nearly always, my first step when troubleshooting a network service on a server - I verify it’s working on the loopback interface…
e.g. with apache - logged into the server console :
telnet 127.0.0.1 80
or
telnet localhost 80
Trying 0.0.0.0...
telnet: Unable to connect to remote host: Connection refused
Tells me it’s not running - because if it was running the message would be different (it would remind you that ^] will exit the session) e.g. :
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
And in NIX we’ve got hundreds of undocumented shortcuts / shorthand for things - e.g. “shorthand” for localhost is “0” (i.e. zero, shorthand for 0.0.0.0 hich is the same/similar to 127.0.0.1) - so
telnet 0 80
If I was testing if SSH (i.e. sshd / openssh-server) was running I could just :
ssh 0
Or
telnet 0 22
If “ssh 0” doesn’t respond - then SSHD isn’t even running. Well - making the assumption clonezilla busybox has telnet client binary installed - you could always try and grab it from another similar architecture machine (e.g. I’ve pulled /usr/bin/telnet from a CentOS 7 machine and put it on a RHEL 7 machine where both are x86_64 when that REL machine wasn’t subsribed to REL repos or even internet connected).
And of course there’s always the tried and true
systemctl status sshd
I know clonezilla supports the SSH client - 'cause it can use SCP / SFTP to clone systems to a remote server - but I don’t know if it runs sshd / openssh-server (I don’t even know what distro they use.
As an aside I once had a big argument with an “alleged” Network Security officer… They deleted the telnet binary off all Linux and Windows computers because it was a security risk… NO YOU NONG! unencryped plain text traffic on port 23 is a security risk - not the binary!
(I don’t know how you’d use the software within a remote SSH session - but - you can run the usual things like “dd” et cetera)
– later on –
After writing that missive above, I thought better of it - there’s little point starting ssh daemon (sshd, but called “ssh”) if your network stack isn’t running - and at that stage of the clonezilla start up process, the network’s not configured or connected (so you can “ssh 0” because only loopback is “plumbed”)…
If this truly works, as intended, this should start up the SSH service properly, on boot-up.
If the above suggestion works as intended, all that should already be set up on boot-up. I guess, we just have to find out, if it really works, as it should.
All that said, in my experience, most of the time such problem arises not because something is turned off, but because there is some barrier/firewall/internet-connection restrictions going on, that is not visible or obvious to the user.
Perhaps it’d be advisable to ask someone from Clonezilla, if SSH may even work as expected, by letting them try it out. Or maybe that Steve from the aformentioned thread can help a bit more.
Then I created a new VM from within virt-manager using this image file.
In virt-manager NAT is the default (other options availabe as well but this one is correct).
When running clonezilla live this way I can perfectly ssh into it:
ssh user@192.168.122.83
is what worked for me .
When SSH-ing into my clonezilla live-VM I get: user@wily:~$
and a command prompt on my host.
BTW: pinging the VM works as well.
So that´s it.
My next challenge will be coming to terms with commands as I naturally don´t have that semi-graphical surface clonezilla provides.
That reminds me of how Virtual Box also has a similar issue. To prevent that issue, users can select “Host-Adapter” or something like that, which allows unrestricted network communication between the VM and the host.
This could be helpful for someone reading this conversation, but needing a fix for Virtual Box.
Yeah - NAT is also the “Default” in Virtual Box - no idea why, it’s one of the least useful options, I always have to pick “Bridged Adaptor” after I’ve created the VM…
Not sure about vmware - I mostly only know VMware via vSphere, and a VM running in an ESX environment with NAT or HOST only networking would be next to useless… I kinda prefer vmware workstation to VirtualBox, but it’s a bit of PITA on Linux (almost EVERY time there’s kernel issues of one sort or another)…