Assigning a serial number to Mojave Guest VMs
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Assigning a serial number to Mojave Guest VMs
In granada29's whatroute.net instructions for making a Mojave Guest, it refers to the user might want to assign a serial number to the Mojave Guest machine. I noticed it shows the serial number as "0".
I couldn't find any reference for how to do that.
Also, what are the disadvantages if no serial number is assigned?
Stephen
I couldn't find any reference for how to do that.
Also, what are the disadvantages if no serial number is assigned?
Stephen
-
- Volunteer
- Posts: 708
- Joined: 3. Mar 2015, 07:27
- Primary OS: Mac OS X other
- VBox Version: OSE other
- Guest OSses: Linux, macOS, Windows
Re: Assigning a serial number to Mojave Guest VMs
I just looked this up. It's in the Help document in Section 9.11
I get a serial number by taking the host system serial number as shown in "About this Mac", and changing the last character.• DMI system information (type 1)
VBoxManage setextradata "VM name" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
granada29, that was so close... reaaaally close...
That command that you entered would work if you had a BIOS booting VM:
You just stole someone else's serial number, your realize that, right? Hope you're not getting into iTunes/AppStore/etc in your VM. But from what it seems you were changing the "pcbios" and not the "efi" part, so all is good...
That command that you entered would work if you had a BIOS booting VM:
For an OSX Guest you need its EFI counterpart:VBoxManage setextradata "VM name" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
VBoxManage setextradata "VM name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "System Serial"
In case your VM is configured to use EFI firmware you need to replace pcbios by efi in the keys.
THIEF!!!granada29 wrote:I get a serial number by taking the host system serial number as shown in "About this Mac", and changing the last character.
You just stole someone else's serial number, your realize that, right? Hope you're not getting into iTunes/AppStore/etc in your VM. But from what it seems you were changing the "pcbios" and not the "efi" part, so all is good...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Re: Assigning a serial number to Mojave Guest VMs
Would the following work, if I wanted the user of the VM to simply set their VM to the same serial number as their Host mac?
...and then use sn.tmp instead of "System Serial"? would that be:
Stephen
Code: Select all
ioreg -l | grep IOPlatformSerialNumber | awk '{print $NF}' sn.tmp
Code: Select all
VBoxManage setextradata "VM name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" < sn.tmp
Last edited by socratis on 25. Oct 2019, 04:08, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
Reason: Enclosed the information in [code] tag for better readability
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
The commands you gave failed for me. What worked was the following (no intermediary "sn.tmp" needed):
First line modifies the VM's config to change the DMI SerialNumber with the output of the 2nd line.
Second raw scans the I/O registry (ioreg -l), filters for IOPlatformSerialNumber (grep IOPlatformSerialNumber), chops just the serial (awk '{print $NF}'), and finally removes the quotes (tr -d \") from that serial number.VBoxManage setextradata "<VM>" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" \ `ioreg -l | grep IOPlatformSerialNumber | awk '{print $NF}' | tr -d \"`
First line modifies the VM's config to change the DMI SerialNumber with the output of the 2nd line.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
BTW, you know you can simply copy the serial from the "About this Mac" and paste it to the Terminal, right?
Hats off to 'granada29' for pointing to the more ... convoluted Copy/Paste solution!
Hats off to 'granada29' for pointing to the more ... convoluted Copy/Paste solution!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Re: Assigning a serial number to Mojave Guest VMs
The idea was to provide a .sh shell script so that my clients could do the process automatically.
Stephen
Stephen
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
There's an even shorter version that doesn't use 'grep', just 'awk' (credit @granada29):
The only thing that I still have a problem with is that the "setextradata" command wouldn't take a quoted value, got to look further into that part...VBoxManage setextradata "<VM>" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" \ `ioreg -l | awk '/IOPlatformSerialNumber/ { print $4 }' | tr -d \"`
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Re: Assigning a serial number to Mojave Guest VMs
@socratis, that first version looks good, so long as the standard MacOS terminal bash shell is fine with that syntax. It would be executed by running a .command shell file.VBoxManage setextradata "<VM>" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" \ `ioreg -l | grep IOPlatformSerialNumber | awk '{print $NF}' | tr -d \"`
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
As already mentioned, the 2nd version is even better, one less tool involved:
VBoxManage setextradata "<VM>" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" \ `ioreg -l | awk '/IOPlatformSerialNumber/ { print $4 }' | tr -d \"`
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Re: Assigning a serial number to Mojave Guest VMs
Didn't you say it wouldn't take quoted value, and you needed to look into it further?
Stephen
Stephen
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
Stephen, I thought you were a programmer...
The quoted value is irrelevant, the
The quoted value is irrelevant, the
tr -d \"
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- Posts: 72
- Joined: 15. Oct 2019, 22:11
Re: Assigning a serial number to Mojave Guest VMs
Ohhhhhhhh.....
But I'm totally happy with your provided solution! Thank you!
Stephen
I get what you're saying. It is weird, because in other examples on the web I've seen people use quoted values.My comment about the quoted values is for both commands...
But I'm totally happy with your provided solution! Thank you!
Stephen
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Assigning a serial number to Mojave Guest VMs
Exactly, that's what I'm saying. And the command itself allows for quoted values, if not asking for them.SteveMacGeek wrote: It is weird, because in other examples on the web I've seen people use quoted values.
I have a feeling that they're double-quoted, as in ""123456"".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.