Knife SSL check fails when workstation is undocked - ssl

My Chef workstation is a virtual machine. I initially setup this machine with Hosted Chef server while the machine was docked in my computer's dock and hardlined to the internet.
When I undock the workstation, the knife ssl command fails with the following error:
c2-device#c2failover-VirtualBox:~$ cd chef/
c2-device#c2failover-VirtualBox:~/chef$ knife ssl check
Connecting to host api.chef.io:443
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
c2-device#c2failover-VirtualBox:~/chef$
I have since assigned a resolvable IP address to the VM workstation as it was using DHCP prior. I'm not sure how to resolve this issue or what the issue may be when undocking my workstation. Does anyone have any possible causes or solutions to the issue I'm seeing?
my network interface is configured as follows:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address XXX.XXX.X.XXX
netmask XXX.XXX.XXX.X
gateway XXX.XXX.XX.XXX
dns-nameservers X.X.X.X
I have not been able to find much in the chef documentation about this issue. Thanks for any help in advance, I'm fairly new to Chef.

This is not related to Chef or knife. You'll need to ensure the VM is able to reach the Internet in general. Overall we do not recommend using a VM as your workstation, you the actual desktop or laptop that you work on.

Related

Unable to SSH between guest VM's which are on different hosts in cluster

I'm having problems SSH'ing between ESXi guests that are on different hosts within the cluster. I've one guest that is on the routable cluster virtual network that I am using as a bastion server to access guests on a private network - the distributed port group spans all hosts.
I'm using SSH ProxyJump to route through the bastion host to the other guest VM's. When the guests on the private network are on the same cluster host as the bastion there is no problem. When the guests are on a different host, I get a connect refused by the remote server error. If I manually migrate the VM to the same cluster as the bastion, the error goes away.
I found this answer which relates to SSH'ing between ESXi hosts, not guests on hosts, and suggests that SSH Client needs to be allowed on the outgoing firewall of each host. It seems like it could be relevant, but my vSphere knowledge is limited and I don't have sufficient admin rights to make this change myself.
I'd be grateful if anyone could confirm if my inability to SSH between guests on different hosts is as a result of not having SSH Client enabled in the outbound firewall or if there is some other reason why I can't get an SSH connection?
From the link you posted:
You need to open the required ssh ports in the ESXi firewall.
In the vSphere Client check the host -> Configuration -> Security Profile -> Firewall -> Properties
and enable "SSH Client" if you need outgoing scp connections resp. "SSH server" if you want to enable incoming scp connections.
Instead of opening SSH client for outgoing firewall of each host, please configure it this way:
Outgoing Server Receiving Server
SSH Client -> Outgoing firewall -> Incoming firewall -> SSH Server
It was an underlying network issue - physical switch was dropping my VLAN tagged packets as VLAN ID wasn't configured on it.

Not able to ping to ESXi6 from centos vm

I am new to esxi.I have installed centos vm on esxi.esxi is connected to network.I have set the static ip to centos.Problem is when i try to ping esxi from the guest vm, its not pinging.I tried google it but i didnt get the info about ip configuration of guestvm(cent os).what should be the proper configuration to connect it to the network
Can you describe you configuration and task more detailed? In general, after ESXi install in Configuration -> Networking you'll see Standard Switch with vmkernel port "Management network" with ESXi IP and portgroup "Vm Network". If you have no VLANs and one subnet, you need to set VLAN ID on both vmkernel and portgroup to "None (0)", and made same subnet/gateway settings on vmkernel and inside guest. At last, you need to set in VM Settings - Hardware -> Network Adapter 1 -> Network Label to "Vm Network". It's difficult to advise more without info.

IBM Server configuration

i have an ibm server, a tp-link router with an static ip and DHCP activated, i want to configure one of the net boards in the ibm server.
I installed Ububntu server and access to the net board configuration using this command:
vi /etc/network/interfaces
I configure the server with this
address -> i put an ip that i resrve in the router
netmask
network
broadcast
gateway
I have a subdomain from no ip i have entered in the server so i can do remote connection to the server throw this subdomain and ssh. I have put the subdomain in /etc/host.conf
The thing is i have access to the subdomain in the web and out of the LAN net. But when i try to connect to the server throw ssh it's gave me connection refused.
EDIT:
Using the command arp-scan -I eth0 -l i found that the IP of the server is asigned two times it's look like it's the same ethernet board with two MAC address thar are the same except the las number.
Ok, what's work for me was to reinstall openssh on the server and in my computer. After that I have access throw ssh.

How to access a web server installed on Hyper-V

I have installed Ubuntu on Windows 8 using Hyper V. Having also installed Apache 2 I had the notion that I was going to use this as a web dev environment. I set up an external switch so that my ubuntu installation could access the internet. So far everything was progressing swimmingly. The problem I am encountering is that I have no idea how to access the web server from my machine. I can get the IP address that ubuntu picks up and type that into my browser whereupon I am informed "It works!". That's all good but I move around among several networks and I should not have to look up the IP address every time, and that can't facilitate having multiple sites installed. I just want to be able to enter something like
"http://mytestserver/"
into my browser to access it.
Any pointers on how to set this up properly would be much appreciated.
I have always had the most success with Bridged networking in VM Guests and would definitley recommend you go with that option. What you then could do and what I have done is to assign a static IP for the server and assign the hostname as below. You will have to know what IP addressing is available or you can use 192.168.1.x if your inside your network.
The easiest way would be to assign a static IP in /etc/network/interfaces replacing the 0.0.0.0 with the correct entries for your network
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 0.0.0.0.0
netmask 0.0.0.0.0
gateway 0.0.0.0.0
broadcast 0.0.0.0.0
dns-nameservers 0.0.0.0.0 0.0.0.0.0
and then edit your /etc/hosts file and add that static IP and add the Hostname mytestserver. You will already have the localhost entry and possibly others. Just make sure you assign the Static IP address you assigned in interfaces to mytestserver. You may also have to make this same entry in your machines hosts file simply because it will not have a DNS record.
127.0.0.1 localhost
0.0.0.0 mytestserver

Overcoming the loopback device on a VM

Due to various constraints I've found myself in the following situation:
I have access to an API which starts a service on the loopback device of a computer (127.0.0.1). This computer is actually running on a VM being hosted by the client. The client will be using the same API to connect (which, of course, will connect via the loopback device).
The API is intended to be a service which executes on the same machine as the host and the client - it's a communication layer essentially. The two software components (ie, the endpoints), are incompatible, so we have them configured this way: the client hosting the server on a VM.
The VM is Virtualbox, with a Bridged Adaptor network setup.
They're both running Windows XP.
How do I get them to communicate?
EDIT: I cannot make changes to the communication service, but I can make whatever other changes are necessary to the VM or the host.
Expanding on #EJP's suggestion to use port forwarding, the required command is covered in User Manual, ยง6.3.1 Configuring port forwarding with NAT. Suppose your service on guest "VM name" is a web server listening on port 80. You can forward host port 12345 to guest port 80 like this:
VBoxManage modifyvm "VM name" --natpf1 "service,tcp,,12345,,80"
When you browse http://127.0.0.1:12345 on your host, the guest server will respond. You can delete the setting using something like this:
VBoxManage modifyvm "VM name" --natpf1 delete "service"
You can examine the setting using something like this:
VBoxManage showvminfo "VM name"
You're going to have to change the service not to bind to 127.0.0.1 if you can. Otherwise you will have to install some kind of proxy in the VM, or organize some port forwarding if you can.