Unix/Linux Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Change hostID of Solaris 10 virtual/guest machine installed by Virtual Box 4.1.12 on Windows-XP host

Solaris


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-23-2012   -   Original Discussion by Matt_VB
Matt_VB's Unix or Linux Image
Matt_VB Matt_VB is offline
Registered User
 
Join Date: Apr 2012
Last Activity: 2 May 2012, 2:26 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Change hostID of Solaris 10 virtual/guest machine installed by Virtual Box 4.1.12 on Windows-XP host

Trying to set or modify the randomly set hostID of a Solaris 10 virtual/guest machine that I installed on a Windows-XP host machine (using Virtual Box 4.1.12).

I was able to set/modify the hostname of the Solaris 10 virtual/guest machine during installation as well as via the Virtual Box command line interface (e.g., VBoxManage, etc.). However, nothing seems to be able to enable me to set/modify the random 8-hexdigit hostID value of the Solaris 10 virtual machine. I want to be able to execute the 'hostid' command from a terminal window on the Solaris 10 virtual machine and have it display a hostID value that I set.

Is there a way to set/modify the hostID value of a Solaris 10 virtual/guest machine that was installed by Virtual Box 4.1.12 (or potentially by any other virtual machine installation tool) on a Windows XP system ?
Sponsored Links
    #2  
Old Unix and Linux 04-25-2012   -   Original Discussion by Matt_VB
hicksd8's Unix or Linux Image
hicksd8 hicksd8 is online now Forum Staff  
Moderator
 
Join Date: Feb 2012
Last Activity: 23 June 2018, 11:33 AM EDT
Location: Devon, UK
Posts: 1,886
Thanks: 281
Thanked 499 Times in 423 Posts
I know how to do this in a Sparc environment but I don't know whether it will work in a x86 environment (although I don't see why not). However, why do you need to do this? Obviously, this can be used to circumvent licensing enforcement so forum moderators might not be too happy about such a solution.

---------- Post updated at 04:11 PM ---------- Previous update was at 03:57 PM ----------

Also, I assume your base layer is Windows?? Have you looked at "macshift" (use Google). This might make it simple to change the MAC address at the bottom layer (the hostid is computed on the MAC address of the interface) thereby changing what Windows thinks it has. When Solaris starts it may well use the same MAC address and solve your problem. Just an after-thought.
Sponsored Links
    #3  
Old Unix and Linux 04-28-2012   -   Original Discussion by Matt_VB
Matt_VB's Unix or Linux Image
Matt_VB Matt_VB is offline
Registered User
 
Join Date: Apr 2012
Last Activity: 2 May 2012, 2:26 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Hicksd8,

Thank you for your reply. Due to the details of the project that I am working on, there are no licensing circumvention issues as far as we can discern.

You mentioned : "I know how to do this in a Sparc environment". If you are able to share that information, that could be very beneficial.

The host machine is Windows, but my project is working in the virtual machine environment ( Solaris 10 ).

Hope that clarifies a few of the things from my original post and thank you again for your reply.
    #4  
Old Unix and Linux 04-29-2012   -   Original Discussion by Matt_VB
jlliagre's Unix or Linux Image
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Last Activity: 20 June 2018, 7:52 PM EDT
Location: Outside Paris
Posts: 4,897
Thanks: 18
Thanked 650 Times in 565 Posts
Quote:
Originally Posted by Matt_VB View Post
Thank you for your reply. Due to the details of the project that I am working on, there are no licensing circumvention issues as far as we can discern.
So what is the problem you are trying to solve by changing the hostid ?
Quote:
You mentioned : "I know how to do this in a Sparc environment". If you are able to share that information, that could be very beneficial.
That probably won't. The way the hostid is stored/retrieved is quite different between SPARC and x86 hardware.
Sponsored Links
    #5  
Old Unix and Linux 04-29-2012   -   Original Discussion by Matt_VB
hicksd8's Unix or Linux Image
hicksd8 hicksd8 is online now Forum Staff  
Moderator
 
Join Date: Feb 2012
Last Activity: 23 June 2018, 11:33 AM EDT
Location: Devon, UK
Posts: 1,886
Thanks: 281
Thanked 499 Times in 423 Posts
This is how I do it.

First decide what hostid you want to set the system to.

NOTE: THE CODE BELOW ONLY APPLIES TO SOLARIS X86

You need to add lines to the bottom of /etc/rc2.d/S20sysetup (which is executed when the system boots).

This is a copy of the whole file after I've added the lines to the bottom with comments to explain what I'm doing............

THIS IS PROVIDED AS AN EXAMPLE ONLY. INPUT YOUR OWN VALUES FOR HOSTID.



Code:
 
#!/sbin/sh
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sysetup 1.27 06/06/05 SMI"
if [ -z "$_INIT_PREV_LEVEL" ]; then
 set -- `/usr/bin/who -r`
 _INIT_PREV_LEVEL="$9"
fi
[ $_INIT_PREV_LEVEL != S -a $_INIT_PREV_LEVEL != 1 ] && exit 0
# Uncomment this line to print the complete system configuration on startup
#[ -x /usr/sbin/prtconf ] && /usr/sbin/prtconf
# If there are trademark files, print them.
[ -d /etc/tm ] && /usr/bin/cat /etc/tm/* 2>/dev/null
#
# Run rctladm to configure system resource controls based on the settings
# previously saved by rctladm.  See rctladm(1m) for instructions on how to
# modify resource control settings.
#
if [ -f /etc/rctladm.conf ] && [ -x /usr/sbin/rctladm ]; then
 /usr/sbin/rctladm -u
fi
#
# Change hostid to 807a6e94
# Convert to decimal value = 2155507348
# Use HEXADECIMAL to BINARY conversion, HEX to Decimal converter, Hexdecimal convertor for heavy lifting
#
# Convert decimal value to ASCII chars = 32 31 35 35 35 30 37 33 34 38
# Use above web site for this too
#
# Pad ASCII char string to eleven values (if necessary) using zeros
# Result 32 31 35 35 35 30 37 33 34 38 0
# If string is only nine chars pad with "00 0" to make eleven
#
# Set the hostid to 807a6e94 - Let's do it!!
echo "hw_serial/v 32 31 35 35 35 30 37 33 34 38 0" | mdb -kw
# That's it!  Job done!
#

Once you've done the added lines you can test it without rebooting by executing:



Code:
 
/etc/rc2.d/S20sysetup

The hostid should change on the fly (or you should get an error telling you what's wrong. Obviously syntax is critical).

Hope that helps. I've just tested it on Solaris 10 (x86).

Last edited by hicksd8; 04-29-2012 at 01:02 PM..
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can i understand if a Java Virtual Machine is installed on Unix?? g_p UNIX for Dummies Questions & Answers 1 03-08-2011 08:12 AM
Solaris virtual machine access on host os ankurk Solaris 2 03-14-2010 06:52 AM
Need suggestions on Virtual Machine software for Windows tlarkin Windows & DOS: Issues & Discussions 1 01-21-2010 05:23 PM
virtual box instalation problem in windows XP machine vr_mari Virtualization and Cloud Computing 4 08-27-2009 09:56 PM
Is there any Virtual data center as we have Virtual Machine? karman0931 Solaris 2 07-18-2009 08:25 AM



All times are GMT -4. The time now is 11:33 AM.