Assign IP address to vm - no access to CLI

I have a VM that was deployed from an OVA file.  It deployed just fine and is up and running.

However, its creators for some reason decided that there would be NO command line access (it's Linux-based)  Evidently, they believe that EVERY network out there is connected to a DHCP server.  

This vm was deployed into a network subnet with no DHCP servers available.

I now need to assign it a static IP so that it can get on the network and do what it is supposed to do. But if I can't log into it, I don't know how to assign it an IP address.

Their support are no help here - they said "Oh, you can do this in VMWare Fusion"  Well, VMWare Fusion has a built-in DHCP-like functionality that it uses for this.  Not applicable in my use case unfortunately.  (We do have vCenter)

Is there a way to give this vm a static IP address by modifying its vmx (or some other) file?
LVL 14
KaffiendAsked:
Who is Participating?
 
KaffiendConnect With a Mentor Author Commented:

Mis-Adventures in Single User Mode


I decided to try to brute-force it.
Modified the vm settings - increased boot delay so that I could access the grub menu
Restarted, keep pressing Shift, and there was the grub menu.
But, it seems it still requires a password (I had learned about single user mode a long time ago, but never had to use it.  I guess it no longer works that way for RedHat-based OS'es anymore.)
Not ready to give up yet.  Went into vm settings again, and made it boot up from a Knoppix CD.  
Knoppix booted up, and I was expecting to see the drives.  No such luck.  In a terminal, fdisk showed me the drives, so I tried to mount the drive.  No dice again, turns out it was a Logical Volume.  Luckily, Knoppix has the tools necessary to manage LVMs.  Then, I was able to see that this was an xfs filesystem.  The tools on the CD couldn't mount the xfs drive.  I guess I could have gone a little further down this particular rabbit hole and try to download more tools into Knoppix, but I decided to cut my losses at this point and give in.  I decided to use a DHCP server.

DHCP server - why it really wasn't a good idea either


So, set up a DHCP server on another vm in that network subnet.  I was extra careful - a scope with only 2 IP addresses, and a DHCP lease of just 30 minutes.  My caution turned out to be warranted.  Between the time I started the DHCP server and then restarted the problem-child vm so that it could get its IP address, something else had already grabbed one of the other IP addresses from this server.  Luckily, the problem-child vm grabbed the other one.  Since the lease was only 30 minutes, no major harm done, I thought.  And at least, the problem-child vm now had an IP address, though not the one I had intended it to get.  Turned off the DHCP server, and modified DNS to reflect problem-child vm's new IP address.  Finally, a little bit of (short-lived) success - I could reach this server, and begin its configuration.  By this time, problem-child vm's support had been in touch, and unfortunately, they confirmed that there was no way to configure this appliance to use a static IP, ever.  (I still can't believe they would do that.  Just seems wrong)  Its web-based console did not offer up anything in the way of network configuration.  So a DHCP server was required - although I suppose I could reduce the DHCP scope to just 1 IP address, and create a reservation for that vm.  But that still leaves me running a specialised service just to support one thing.

The answer to my question exists


Turns out, VMWare does have a way to assign a static IP address to a VM.  
The way to do that is to create a Custom Specification Policy, and apply that to the vm.  It allows one to specify IP address, subnet mask, default gateway, DNS server - everything I was looking for.
(This feature is definitely available in vCenter, I don't know if you can do that with only a standalone ESX host)


I will assign myself the solution as I was able to solve my problem exactly the way I wanted.  
Noci and QLemo gets assists for the moral support.
Sara2000 also gets an assist - her solution would also have worked (if only the authors had included those configurable properties, which unfortunately, they didn't)
0
 
nociConnect With a Mentor Software EngineerCommented:
not realy, would it be a problem to spin up a simple CD-ROM based linux and let that provide a DHCP for the time being?
or do you have a simple AP/Router  have laying around, enable DHCP on and link the LAN port to your VM's network interface.
that is probably the fastest aproach i can think of.

Your problem is you need to change the config witin the Linux Virtual disk. Not the description of the system. DHCP ienabled/disabled is part of the network configuration. Found in /etc/network/interfaces or /etc/sysconfig/networking-scripts/
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
vCenter allows to use a remote console for the VM, which is like sitting in front of the machine. You can log in, and make the necessary change as described above.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Sam Simon NasserIT Support ProfessionalCommented:
whats the system exactly? Zabbix, Elastix, NAGIOS,  etc... !
knowing the system you installed using the OVA will make it easier to know how to change, and since its a Linux then differently there is CLI access.
0
 
nociSoftware EngineerCommented:
Oh i forgot, all VM services i known of do have SOME means to allow console access, either through RDP or through VNC, access should be possible. What is the VM environment your are using?
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
noci, "vCenter" is the management service for (multiple) VMware ESX hosts (called vSphere). And I have posted about that option in #a42510334 already.
1
 
KaffiendAuthor Commented:
Thanks for the comments and suggestions.

Just to be clear - I do have access to the console, but without any kind of login credentials, I might as well be staring at a blank wall.  The poopooheads who created this thing have taken the position that they do not want anyone doing anything on the command line, so they are not providing credentials.  IMHO, that's fine, but they should have taken into consideration that not all networks will have a DHCP server and at least provided their appliance with a default IP address if no DHCP server was available.

Noci, your response gave me an idea - I suppose I could maybe force it into single user mode, and edit the networking configuration files from there, adding IP address, subnet mask, gateway, DNS, etc.  Although, I was hoping for a better (cleaner?) solution.

I could also sneak a DHCP server onto that network subnet, and do initial network configuration.  I could even copy the whole thing on to a USB drive, and use DHCP in my home lab.  But I'm stubborn as a mule, and don't want to have to do it that way - it just seems to be the wrong way to do it.  (But also a realist, if I have no other choice, I'll do what I have to do to get things done)

Since it's freshly deployed and not doing anything, I can delete the whole thing and start over.  I was thinking (hoping?) there was maybe a way to modify the ova file itself, or in some advanced VMWare settings that I don't know of.
0
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
Nothing in VMware will allow to set the IP by injecting something.

I agree that stubborn meets stubborn here ;-)
Your only choice is probably to give in and allow a DHCP server to be reachable.
0
 
sara2000Connect With a Mentor Commented:
Some vendors's appliance has an option to assign ip via vApp option.
0
 
nociSoftware EngineerCommented:
The OVA has nog default password? tried the simple ones?
root/root
root/toor

Googled for admin password with the name of your OVA?
0
 
Sam Simon NasserIT Support ProfessionalCommented:
Kaffiend
 Whats the system you installed? the OVA system? at least give us its name to help?
0
 
KaffiendAuthor Commented:
Sam,

I don't want to call out somebody's shortcomings and name them in a (semi)public forum.  Let's just say they are an up-and-coming security-related outfit.  The first ova I was supplied wouldn't boot.  the second ova boots, but landed me in the situation I find myself in.  I think the virtual appliance is something relatively new to them.

I appreciate that you all are trying to help, though.


Sara2000 - you were the first to bring up that some of these do actually have configurable properties.  In researching a way to get out of my dilemma, I had found out about that as well.  So, I downloaded ovftool and "probed" the ova file.  No such luck, unfortunately - the properties I wanted to configure were not there.  Oh well.

And yes, I did try root/root, admin/admin, root/passwd and a few other combinations   : )
0
 
Sam Simon NasserIT Support ProfessionalCommented:
Kaffiend,
i do not want you to declare you security setting, network configuration or anything. system name only is enough to figure out a solution.
i.e. if you said nagios monitor system system, or zabbix monitoring system, or Elastix PBX, or or or, we can figure out the CLI access, username and password and all the details you want.

eventually its up to you.
1
 
nociSoftware EngineerCommented:
With DHCP you could have made a reserved lease (in an 1 address scope) and assign that to MAC adress of your VM. The MAC address is set by vmware, so it is known from the outside. That way DHCP could never be misused by any other equipment.
This could even be used to have a stable solution until a better one arrives. Glad you have found some way to assign an IP address.
1
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Customizing is applied to templates on deployment. But if that works for you, great.
Those XML files are stored in vCenter only, see https://docs.vmware.com/en/VMware-vSphere/6.0/com.vmware.vsphere.vm_admin.doc/GUID-EB5F090E-723C-4470-B640-50B35D1EC016.html:
"vCenter Server saves the customized configuration parameters in the vCenter Server database."
0
 
KaffiendAuthor Commented:
Ultimately, the solution that I found on my own, was the best solution in this particular case.

(But I do appreciate that others tried to help me)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.