In a virtual machine environment, I can use sigar to get the virtual machine's mac address, but how to get mac
address of the host?
Asked
Active
Viewed 522 times
0

Maroun
- 94,125
- 30
- 188
- 241

user2959459
- 11
-
You never know whether you are in a BOX – farmer1992 Nov 06 '13 at 08:10
1 Answers
0
try to use NetworkInterface
,
all is explain here : http://www.mkyong.com/java/how-to-get-mac-address-in-java/

Mathiewz
- 189
- 1
- 12
-
-
oh, sorry, i didn't get the problem However, i think this is not possible to know the host's mac address because of java can't know if it is executed in a box – Mathiewz Nov 06 '13 at 09:54
-
yes, I agree. At least not in a trivial way which wouldn't need some "hacking". – eis Nov 06 '13 at 10:26