VMware Cloud Community
choko_smile
Contributor
Contributor

How to detect machine is virtual or not on Linux 64 bit machine

Hi all,

I want to detect if machine contains virtual OS or not for linux 64.

Do VMware itself provides such a tools,

If yes, How can we get that?

Thanks in Advance ,

0 Kudos
7 Replies
weinstein5
Immortal
Immortal

Welcome to the forums! - I believe the only way you can tell if the O/S is running on virtual hardware is by looking at the hardware drivers that get loaded particularly if VMware tools is loaded - I know this is the only way you can see it in windows -

If you find this or any other answer useful please consider awarding points by marking the answer helpful or correct -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
ElectroVM
Contributor
Contributor

Use /usr/sbin/dmidecode if you have it. Grep for VMware. Since it's virtualized hardware, it will give you the Virtual maker....

0 Kudos
continuum
Immortal
Immortal

Have a lok at http://chitchat.at.infoseek.co.jp/vmware/vmtools.html#vmw - there is a linux port

> I believe the only way you can tell if the O/S is running on virtual

hardware is by looking at the hardware drivers that get loaded

particularly if VMware tools is loaded - I know this is the only way

you can see it in windows -

Nope - on Windows there are several ways to find out if you are running in a VM other than looking a the virtual hardware.

___________________________________

description of vmx-parameters:

VMware-liveCD:


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Dave_Mishchenko
Immortal
Immortal

Your discussion has been moved to the Virtualization Technology & Industry forum.

Dave Mishchenko

VMware Communities User Moderator

0 Kudos
Texiwill
Leadership
Leadership

Hello,

The best way is to look for the VMware backdoor. This is a well known communication path that VMware Tools use. You can also look at the base hardware presented to the VM. VMs have a very distinct foot print.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

SearchVMware Blog: http://itknowledgeexchange.techtarget.com/virtualization-pro/

Blue Gears Blogs - http://www.itworld.com/ and http://www.networkworld.com/community/haletky

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
choko_smile
Contributor
Contributor

Hi,

As your suggestion I got the code for VMWare backdoor. But It doesn't work

on Linux 64. I mean the inline assembly code is not getting compiled.

Throwing these errors:

/tmp/ccjS8o5l.s:10: Error: suffix or operands invalid for `pusha'

/tmp/ccjS8o5l.s:10: Error: suffix or operands invalid for `push'

/tmp/ccjS8o5l.s:10: Error: suffix or operands invalid for `pop'

/tmp/ccjS8o5l.s:10: Error: suffix or operands invalid for `popa'

/tmp/ccjS8o5l.s:23: Error: suffix or operands invalid for `pusha'

/tmp/ccjS8o5l.s:23: Error: suffix or operands invalid for `push'

/tmp/ccjS8o5l.s:23: Error: suffix or operands invalid for `pop'

/tmp/ccjS8o5l.s:23: Error: suffix or operands invalid for `popa'

/tmp/ccjS8o5l.s:35: Error: suffix or operands invalid for `pusha'

/tmp/ccjS8o5l.s:35: Error: suffix or operands invalid for `push'

/tmp/ccjS8o5l.s:35: Error: suffix or operands invalid for `pop'

/tmp/ccjS8o5l.s:35: Error: suffix or operands invalid for `popa'

Is there any Linux 64 specific code, which will detect VM?

Thanks and Regards,

Bharati

0 Kudos
Texiwill
Leadership
Leadership

Hello,

I would look at the open source vmware tools for help on this. http://open-vm-tools.sourceforge.net/


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

SearchVMware Blog: http://itknowledgeexchange.techtarget.com/virtualization-pro/

Blue Gears Blogs - http://www.itworld.com/ and http://www.networkworld.com/community/haletky

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos