Showing posts with label Virtual Machine. Show all posts
Showing posts with label Virtual Machine. Show all posts

Saturday, September 3, 2011

VirtualBox Mac OS X 10.7.1 EFI

Like booting Mac OS X 10.6.8 Snow Leopard using VirtualBox, I found a way to boot Mac OS X 10.7.1 Lion using "Enable EFI (for special OSes only)". Websites discussing such things suggest using the Mac App Store to buy Mac OS X 10.7 Lion.

Get the Mac OS X Install ESD.dmg disk image from Mac OS X 10.7 Lion the Mac App Store. Then, the general steps are to create disk images for the LionInstaller and one as a Lion Starter. Restore the BaseImage.dmg image to the LionInstaller, copy Mac OS X Install ESD files over, altering some files, download some preparation files. Sutdown and uncheck Enable EFI. Start using a Mac EFI emulating booter (like Empire EFI, iBoot, nawCom, or HackBook). Create your Lion Starter image using MultiBeast and copy over utilities. Shutdown, remove the Snow Leopard disk image, add a Lion disk image, Enable EFI, and boot to the LionInstaller. Install Lion to the Lion disk image and shutdown when the installation is complete. Uncheck Enable EFI and boot into the Lion Starter to boot into Lion. Erase PlatformSupport.plist, install PlatformUUID.kext using a kext installer, Shutdown, "Enable EFI", and boot into Lion (you can remove the LionInstaller and Starter disks). Download and install the 10.7.1 update from www.apple.com. Install the rest of the updates. The instructions require an existing VirtualBox Snow Leopard VirtualBox VM (Virtual Machine) and a processor supporting VT-x (Intel) or AMD-V (AMD). Here are instructions:

1) Boot into Snow Leopard and purchase Mac OS X 10.7 Lion from the Mac App Store. Shut down the Snow Leopard VM.
2) Click the Snow Leopard VM and click Settings, click Storage, click Add Hard Disk, click Create new disk, select VDI (VirtualBox Disk Image) and click Next, click dynamically allocated and click Next, type LionInstaller for Location and leave 5 GB for size and click Next, and click Create.
3) Click Add Hard Disk, click Create new disk, select VDI (VirtualBox Disk Image) and click Next, click dynamically allocated and click Next, type Starter for Location and type 100 MB for size and click Next, and click Create.
4) Start Snow Leopard. You are prompted that the disk is not readable (twice), click Initialize (twice).
5) In Disk Utility, select the Select 5.0 GB VBOX HARDDISK Media, Click Partition, Select 1 Partition under Volume Scheme, Name: LionInstaller, click Apply, and click Partition.
6) In Disk Utility, select the Select 100 MB VBOX HARDDISK Media, Click Partition, Select 1 Partition under Volume Scheme, Name: Starter, click Apply, and click Partition.
7) Open the Mac OS X Install ESD.dmg
8) From the dock (or from Finder), click Applications -> Utilities -> Terminal
9) In Terminal, type cd "/Volumes/Mac OS X Install ESD", press enter, type open BaseSystem.dmg, and press enter.
10) In Disk Utility, click the LionInstaller partition and click Restore, drag Mac OS X Base System to the Source field, drag LionInstaller to the Destination field, click Restore, and click Erase, and Enter password and click OK. Close Disk Utility
11) Rename new Mac OS X Base System volume as LionInstaller and switch back to Terminal
12) Into Terminal, type cp kernelcache /Volumes/LionInstaller/kernelcache and press enter, type cp mach_kernel /Volumes/LionInstaller/ and press enter, and type sudo vi /Volumes/LionInstaller/Library/Preferences/SystemConfiguration/com.apple.Boot.plist and press enter and type your password and press enter.
13) In vi (a Terminal text-based text editor), press the down arrow then the right arrow until you reach the end of the line . Press a (to append or add text).
14) Press enter, press tab, type Kernel Cache and press enter, type \kernelcache and press enter. Press ESC, type :wq, and press enter (to exit vi)
15) In Terminal, type sudo rm /Volumes/LionInstaller/System/Installation/Packages and press enter. If required, type your password and press enter. Type sudo cp -R Packages /Volumes/LionInstaller/System/Installation/Packages and press enter. If required, type your password and press enter.Type cd /Volumes/LionInstaller/System/Library/CoreServices and press enter. Type sudo touch ServerVersion.plist and press enter. Type cd ~ and press enter. Type cp /Volumes/LionInstaller/System/Installation/Packages/OSInstall.mpkg . and press enter. Type pkgutil --expand OSInstall.mpkg OSInstall and press enter. Type vi OSInstall/Distribution and press enter. In vi (Terminal text-based text editor), press down arrow to the line function isVirtualMachine(){.
16) Use down arrow and type dd and delete lines between function isVirtualMachine(){ and return false;. Type dd and delete lines between return false; and the enclosing }. (so you should see three lines, isVirtualMachine(){ then return false; then })
17) Use down arrow and type dd and delete lines between function isSupportedPlatform(){ and return true;. Type dd and delete lines between return true; and the enclosing }. (so you should see three lines, isSupportedPlatform(){ then return true; then })
18) Press ESC, type :wq, and press enter.
19) Download KextBeast and MultiBeast from tonymacx86.com (to Snow Leopard and Empire EFI (or download iBoot, nawCom, or HackBoot on your host system) from prasys.info (find PlatformUUID.kext and download it to Snow Leopard if you did not use Empire EFI).
20) Shutdown. In VirtualBox, click Devices -> Choose a virtual CD/DVD file..., pick Empire EFI (or iBoot, nawCom, or HackBoot), and click Open. Click the Virtual Machine and click Settings. Click System and uncheck Enable EFI. Click OK. Start Snow Leopard and boot to the Snow Leopard disk.
21) Run MultiBeast.Click Continue, Continue, Continue, Agree, select EasyBeast Install and click Continue, click Change Install Location..., click Starter, and click Starter, select EasyBeast Install and click Continue, click Install, type password, and click Close.
22) Copy PlatformUUID.kext from Empire EFI from the within Preboot.dmg \Extra\Extensions
folder to Starter. Copy KextBeast to Starter. Shut down Snow Leopard.
23) In VirtualBox, select the VM and click Settings. Click System and check Enable EFI (for special OSes only) Remove the disks, click Add Hard Disk on the SATA Controller, click Create new disk..., click VDI (VirtualBox Disk Image) and click Next, click Dyamically allocated and click Next, OSX86-64Lion click Next and click Create. Add LionInstaller disk to IDE Controller (click Add Hard Disk, click Use existing disk, select LionInstaller and click Open). Click System, Change memory to 2048 MB. Click OK. Click Start.
24) It will boot to the LionInstaller and start the Lion installation process. Click Next. Click Utilities -> Disk Utility, select 21.47 GB VBOX HARDDISK Media, select Partition, select 1 Partition under Partition Layout and Name Macintosh HD and click Apply, click Partition, click Close. Click Continute, click Agree, select Macintosh HD and click Install. After the install, Shutdown.
25) Click the VM and click Settings. Click Storage, remove LionInstaller.vdi and replace it with Starter.vdi. Click System and uncheck Enable EFI (special OSes only). Click OK. Start the VM. It will boot to the Starter then to Lion, which will start the first boot Lion process.
26) Click Continue, click Continue, click Continue, click Continue, click Continue, click Continue, create your computer account and click Continue, select time zone and click Continue, click Start Using Lion.
27) Delete /System/Library/CoreServices/PlatformSupport.plist. Copy PlatformUUID.kext to the Desktop and run KextBeast. Shutdown.
28) Click the VM and click Settings. Click System and uncheck Enable EFI (special OSes only), click Storage and remove Starter. Click OK. Start VM
29) Download and install the 10.7.1 update from www.apple.com. The install will require a restart. Download and install the other updates from www.apple.com.

Friday, September 2, 2011

VirtualBox Mac OS X 10.6.8 EFI

I come to find a better way to virtualize Mac OS X 10.6.8 Snow Leopard on VirtualBox. Apparently, you don't need a boot CD (Empire EFI on the last VirtualBox Mac OS X post) to run before the installer and as a booter to boot into. I found elsewhere that Snow Leopard can be installed onto VirtualBox directly with Enable EFI checked and a change to the vbox settings file. Again, this source's instructions said to buy Snow Leopard on retail. AMD or Intel virtualization needs to be enabled on the host (VT-x or AMD-V).
1) Download and install VirtualBox from http://www.virtualbox.org. Open VirtualBox.
2) Click New, give it a name like OSX86-64, choose Maco OS X for Operating System and Mac OS X Server (64 bit) and click Next
3) Give it memory. 1 GB is sufficient for Snow Leopard but 2 GB is needed for Lion by default. Click Next.
4) With Startup Disk checked and Create new hard disk selected, click Next
5) With VDI (Virtual Box Image) selected, click Next.
6) Dynamically allocated may save space (only takes space as needed but doesn't automatically give it back). Fixed size may run faster but takes up all the space you specify. Dynamically allocated is sufficient.
7) Give it a name for location, like OSX86-64, default size 20 GB is ok, and click Next. Click Create, click Create.
8) Close VirtualBox
9) Edit the VirtualBox settings file, by default in %userprofile%\VirtualBox VMs\OSX86-64\OSX86-64.vbox. In the ExtraData section (in between and ), add . Save and close the file. Open VirtualBox. (If you want to see the Apple logo boot screen, add
10) Start the Virtual Machine. It starts to a first run wizard. Click OK, Next, pick the OS X Snow Leopard media, click Next, and click Start.
11) Run through the setup process:
(English, Continue. From the Utilities menu, click Disk Utility, click the 21.47 GB VBOX HARDDISK Media, and click Partition. From Volume scheme, select 1 Partition, name: Macintosh HD, click Apply and click Partition. When done, click Quit Disk Utility from the Disk Utility Menu. Click Continue, click Agree, select Macintosh HD and click Install. Restart when done.)
12) Run through the first setup steps.
13) Download and install the Mac OS X 10.6.8 Update Combo from Apple.com. Restart. Download and install the other updates.

I find it interesting that the Apple switch to Intel processors combined with the popularity of virtualization technology has opened this door. This would be more difficult to do were Apple still using only Power processors. It makes me wonder if Apple plans to port their ARM processor (Apple A4/5) "back to the Mac." I'm most familiar with Windows operating systems, and I'm interested in learning more about other operating systems. However, I am more interested in BSD (FreeBSD), which is used in Mac OS X. I'd also interested in Linux. It is said that Apple's iOS is a walled garden, and I kind of view Mac OS X in the same light.

Friday, May 20, 2011

Directory Services Restore to Virtual from Physical

I've restored Windows Server 2003 Active Directory Directory Services from a physical to a virtual server lately probably more times than is reasonable, four successful, one unsuccessful (see note about cavalier deletion of network registry keys below). I've been playing with Domain Rename operations in Windows Server 2008 (R2 in this case) and the hiccups. Unfortunately, it doesn't sound like my company will be changing our .local domain to .com any time soon as Microsoft does not support domain name changes in Microsoft Exchange 2007 or 2010 (http://technet.microsoft.com/en-us/library/cc816848%28WS.10%29.aspx). I found that three of our more important server applications can handle it, it seems. Earlier, I elucidated steps to backup physical/restore virtual Active Directory involving 3 virtual machines and a bunch of tools. I think now I'm doing it more streamlined:

1) Backup the system state of the Domain Controller (or Active Directory Server or Directory Services server) using NTBackup (in Advanced Mode to select only the System State) on Windows Server 2003 (we're moving to 2008 soon though).
2) Create the Windows Server 2003 virtual server (up to date, with the virtual machine additions) and copy over the backed up system state.
3) Move the virtual server off the production network to prevent interfering with the production environment.

4) Give the network adapter of the virtual server a static address. I matched the address of the physical server and also added the Domain Controller (Active Directory) role to match the configuration I was restoring. As I was restoring the system state, this step might be unnecessary.
5) Restart in Directory Services Restore Mode by pressing F8 after the BIOS screen before the Windows screen, selecting the option and pressing enter.
6) Log in to Windows, run NTBackup in Wizard Mode, select the backup file, and restore the system state. After completing the restoration, clicking Close prompts a restart. Restart.
7) Pressing F8 after the BIOS but before the Windows splash screen, selecting Safe Mode, and pressing enter allowed Windows to detect the new hardware (trying to boot into Windows in normal mode would hang in my case), but because I was restoring an OEM copy, I had to repair Windows.

8) After restoring the system state, I was left with (not strictly necessary) services that no longer started that I could delete. I used sc delete to delete them. I also changed the mfevtp and mfehidk services to manual start. Not necessary if you don't mind seeing "One or more services failed to start..." on startup.
9) Give the presumably new network adapter a static IP address. Again, I matched the restored configuration.
10) Open DNS from Start -> Administrative Tools. Expand to the forward lookup zone(s), right-click the zone and click Properties. Click the Name Servers tab, select, and remove the Name Servers not being restored. Do the same for the reverse lookup zone(s), if applicable.
11) Open Active Directory Sites and Services from Start -> Administrative Tools. Make sure for the server(s) that remains, that GC is checked by right-clicking its NTDS Settings and clicking Properties. Delete the servers that won't be restored from under its NTDS Settings. For each server not restored under Sites - - Servers, expand NTDS Settings and remove the other servers. Delete NTDS Settings, choose "This domain controller is permanently offline and can no longer be demoted using Active Directory Installation Wizard (DCPROMO)", and click Delete. Delete the Server as well.
12) Open Active Directory Domains and Trusts from Start -> Administrative Tools. Right-click Active Directory Domains and Trusts and click operations Master. A restored server should be Domain Naming Operations master. If not, change the role by seizing it.
13) Open Active Directory Users and Computers from Start -> Administrative Tools. Right-click Active Directory Users and Computers, click All Tasks - Operations Masters...
Make sure a restored server is Operations master for RID, PDC, and Infrastructure roles. If not, change the roles by seizing them.
14) If not installed, install the Windows Server Support Tools from the installation media ( \SUPPORT\TOOLS\SUPTOOLS.MSI). Click Start->Run, type regsvr32 schmmgmt.dll and click OK, OK. Click Start -> Run MMC and click OK. Click Console Root and click Add/Remove Snap-In..., click Add, select Active Directory Schema, click Add, Close, and OK. Right-click Active Directory Schema and click Operations Master
Make sure a restored server is Operations master.
15) Open Active Directory Users and Computers from Start -> Administrative Tools. Expand the Domain and click Domain Controllers. Press delete for the domain controllers not being restored, select "This domain controller is permanently offline and can no longer be demoted using Active Directory Installation Wizard (DCPROMO)" and click Delete and Yes.
16) Open DNS from Start -> Administrative Tools. Delete (Same as parent folder) entries for other DCs in domain.local forward lookup zones for domain controllers not being restored. Double-click DomainDnsZones and delete (Same as parent folder) entries for other DCs
Expand DomainDnsZones - _sites - Default-First-Site-Name - _tcp and delete entries for domain controllers not being restored. Expand DomainDnsZones - _tcp and delete entries for domain controllers not being restored. Double-click ForestDnsZones and delete (Same as parent folder) entries for domain controllers not being restored. Expand ForestDnsZones - _sites - Default-First-Site-Name - _tcp and delete entries for domain controllers not being restored. Expand ForestDnsZones - _tcp and delete entries for domain controllers not being restored. Expand _msdcs - gc and delete entries for domain controllers not being restored.
17) Make sure SYSVOL and NETLOGON are being shared (browse \\HOSTNAME or \\localhost). The most recent time I did this, I saw a folder called NtFrs_Preexisting___See_EventLog under c:\Windows\Sysvol\Sysvol\Domain.local\, so I made a copy, moved the scripts and policies out of the folder and under the domain.local folder and deleted the NtFrs_... folder. Then I opened regedit (Start -> Run -> regedit OK), changed BurFlags to d4 under HKLM\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Processes and restarted the NtFrs service to get Sysvol (c:\Windows\Sysvol\Sysvol) and Netlogon (c:\Windows\Sysvol\Sysvol\Domain.local\scripts) shared.
18) At this point, I have a domain controller that can be joined to. Unfortunately, in my cases, this domain controller now has Registry entries, Add\Remove Program entries, and files that may be suspect, so at this point, I preferred to join to it a clean virtual server, promote that server to a domain controller with DNS, and transfer operations master roles to it then demote and disjoin the "dirty" server from that domain.

Thursday, May 19, 2011

...Or don't. Network Adapters in Windows Registry

Let's say you learned where Windows stores network card/adapter information in the registry, and you were playing with recovering a backup of Windows Server 2003 Active Directory to different, virtual hardware. Don't decide it a good idea to clean out the network adapters in the registry by uninstalling the virtual adapter and deleting all adapters in the registry. It's a bad idea.

I have been playing around with a few things: recovering Active Directory to different hardware (to a virtual PC/server), seizing FSMO (Flexible Single Master of Operations or operations master) roles, transferring operations master roles, a Windows Server 2008 R2 domain controller and adprep, and Domain Rename. I've done this three times successfully and once unsuccessfully.

During the unsuccessful attempt, I backed up the system state of our first production domain controller running Windows Server 2003 R2. I created a virtual machine running Windows Server 2003, placed it on a virtual switch not paired to a physical network card, and promoted it to a domain controller. I restarted in Active Directory Recovery Mode, restored the backup, and rebooted to Safe Mode. I had to repair Windows because I had restored an OEM copy of Windows Server 2003 R2 onto a volume license copy of Windows Server 2003. I uninstalled the network adapter from Device Manager and went into the registry and removed the network adapters. All I can say for certain is after restarting, Windows could not start the virtual network adapter. It said one or more files could not be found. I tried using the installation media and the local drive as the source for updated drivers and tried reinstalling the virtual machine additions, but it didn't help. My thought is that Active Directory is bound to network adapters. I notice domain controllers take longer to start up than other Windows Servers at the Preparing network connections phase of startup.

In some cases, this sort of difficulty would have me digging into the situation. In this case, my reaction was I'm not doing that again.

Saturday, March 5, 2011

Backup Active Directory from hardware, restore to Virtual sandbox

Let's say you experienced a disaster scenario. You had domain controllers hosted on Dell server hardware that are no longer accessible. You have a backup but only of one domain controller's system state from Windows Server 2003 R2's NTBackup. The Dell ran an OEM-licensed version of Windows Server 2003 R2 Standard Edition. You need to restore Active Directory to a virtual machine to a volume licensed version of Windows Server 2003 Standard (not R2). This is the closest to an imaginable scenario I could come up with for what I did.

I want to test out server software on a sandbox domain resembling our production environment. I want to learn VMWare (we're looking to virtualize, at least partially, for the sake of server consolidation, disaster planning, high availability, and colocation). Beyond a lab learning environment, I'd never had to recover Active Directory. All that being said, there are better ways to do what I'd done, and I knowingly went against Microsoft recommendations (more accurately, I did things Microsoft recommends against doing) in at least a couple of places. For example, I could have much more easily used VMWare Converter to virtualize servers, but I didn't want to install VMWare Converter on a production domain controller (DC). Microsoft recommends against seizing roles in favor of transferring them and recommends recovering all your DCs (then transferring roles and demoting servers). Microsoft recommends against locating the global catalog on the infrastructure master server (I am only in a single domain forest though).

Here's a play by play:
I backed up the system state of our first domain controller (DC) holding most operations master roles using NTBackup, which is running OEM installed Windows Server 2003 R2 Standard Edition on reliable, powerful Dell server hardware.
I created an up to date (Windows Updates) virtual Windows Server 2003 Standard server with VMWare Tools and set it up to mirror that production DC (set it up as the typical first server, with Active Directory Domain Services, DNS, and DHCP adding WINS). This server was not connected to the production network (only an internal virtual network).
I copied over the backup, rebooted into Directory Services Restore Mode (DS RM), and restored the system state.
Side note: Doing nothing else, if I rebooted, Windows Server would not start reliably (I think it started once... maybe). The hardware was too different. The HAL and kernel were for a multiprocessor system, the virtual server was a single processor. I could get it to boot by replacing hal.dll, ntoskrnl.exe, ntkrnlpa.exe, and kernel32.dll, but then I couldn't log in due to a licensing/activation issue. On Windows Server 2008 or 2008 R2, I may have been able to work around this but I couldn't figure it out on Windows Server 2003 (seen mention registry locations, wpa.dbl, licensing libraries - dlls, and executables - I'm sure a Microsoft guy would cringe at my attempt) .
I rebooted to the Windows Server 2003 installation media, pressed enter to install, accepted the license, and r to repair.
Side Note: Now some of the virtual machine was showing Windows Server 2003 R2. I could log in but could not join the domain ("The domain name [DOMAIN] might be a NetBIOS domain name. If this is the case, verify that the domain name is properly registered with WINS. ..." or "The following error occurred when DNS was queried for the service location (SRV) resource record used to locate an Active Directory Domain Controller for domain domain.fqdn: The error was: "This operation returned because the timeout period expired."...").
I logged in and did some cleanup. Some installed services didn't start as the programs weren't there. Some programs in Add/Remove Programs weren't there. For this, I used the Windows Installer Cleanup Utility, the sc delete command, CCleaner, and some altering of the registry. For Microsoft.NET, I had to do some ugly ripping from the registry (Microsoft cringe #2). I updated the server. I demoted the other domain controllers forcibly using Active Directory Sites and Services (delete the replication partners in NTDS Settings, delete NTDS Settings and delete the Server) (Microsoft cringe #3).
I removed the other DCs from Active Directory Sites and Services and DNS. Where possible, I tried to use the GUI but had to delete some DNS entries manually. When satisfied, I backed up the system state, saved it out. I shut down this first server. I created another a second "typical first server" Active Directory, DNS, and DHCP adding WINS up to date with Windows Updates and with VMWare tools. I copied the backup down, rebooted into DS RM, restored the system state and rebooted.
Along side of this more civilized and cleaner DC, I brought up a Windows Server 2003 server without roles but with updates and VMWare Tools. I installed the Active Directory role on this server as a second server on the domain to the cleaner first server on the domain. I added the DNS role and WINS. I made WINS a replication partner on both servers, replicated the data, deleted the replication servers and removed WINS from the other server. I added the DHCP role (initially unactivated), copied over the settings, deactivated the original DHCP server, activated the new DHCP server, and removed the DHCP server role from the original DHCP server. I removed the original DNS server from responding to requests, made the new DNS server the primary on zones, removed it from the zones, and removed the role from the first server. I transferred over the roles (PDC emulator, RID master, Infrastructure master, schema master, and domain naming master) using the interface. Finally, I removed the Active Directory role (demoting the server) and got rid of every server except the new AD, DNS, DHCP, and WINS server.

To summarize, the steps were as follows:
1) Backup the system state using NTBackup from the DC holding most master roles.
2) Create the virtual machine server (with updates and VM tools) in isolated environment. Use dcpromo or Add or remove server roles to add the domain controller role as a typical first server, configuring to mirror the environment to be restored. Restart at the end of the installation wizard.
3) Copy over the system state backup. Restart and start in Directory Services Recovery Mode. Restore the system state using NTBackup.
4) Insert the Windows Server installation media. Restart and boot to the installation media. Repair the installation (past the recovery console, a repair installation).
5) Clean up the wreckage. Forcibly demote the servers that will not be restored. Use Windows Installer Cleanup Utility, CCleaner's Add/Remove Programs entry deleter, CCleaner's registry cleaner, sc delete command, and regedit (to remove some services, drivers, and programs manually)
6) Backup the virtual domain controller's system state using NTBackup. Copy the backup file out and shut down this server.
7) Create a second virtual machine server (with updates and VM tools) in isolated environment. Use dcpromo or Add or remove server roles to add the domain controller role as a typical first server, configuring to mirror the environment to be restored. Restart at the end of the installation wizard.
8) Copy over the system state backup. Restart and start in Directory Services Recovery Mode. Restore the system state using NTBackup.
9) Create a third virtual machine server (with updates and VM tools) in isolated environment. Use dcpromo or Add or remove server roles to add the domain controller role. Add this domain controller to the second server's existing domain. Restart when complete.
10) Add the DNS and WINS rules. Add but do not configure the DHCP role.
11) In WINS on the second server, add the third server as a replication partner. On the third server, add the second server as a replication partner. Initiate replication from either or both servers.
12) Duplicate the DHCP settings from the second server (changing, where necessary, to reflect the third server's planned role). Unactivate DHCP from the second server and activate DHCP on the third server. Remove the DHCP role from the second server. If WINS has finished replication, remove the WINS role from the second server.
13) Configure the third server's DNS with the intention of it being the DNS server (make the third server the primary server in the zones). Remove the second server from the third server's DNS. Remove the DNS role from the second server.
14) Transfer roles. RID, PDC, and Infrastructure can be transferred from Active Directory Users and Computers from the second server by connecting to the third server domain controller. Transfer Domain Naming Master can be done in Active Directory Sites and Trusts from the second server connecting to the third. Schema Master can be transferred from Active Directory Schema, but you may need to register it (regsvr32 schmmgmt.dll) and open it from mmc (Microsoft Management Console). This all can be done from the command line using ntdsutil.
15) Remove the Domain Controller role from the second server (using Add or Remove Roles or dcpromo), demoting it.
16) Now you can get rid of the first and second servers.

Friday, March 4, 2011

VirtualBox Mac OS X 10.6.6

I found instructions elsewhere that Mac OS X can be run on Oracle VirtualBox. The instructions say to buy Mac OS X Snow Leopard from a retailer or official channels, which can be had for $39.99. However, if my understanding is correct, this is the "upgrade" price (you can't buy a Mac without OS X, so you either have the current version an older version). Also, I believe the price of the operating system is hardware subsidized - that if Apple sold operating systems independent of hardware, OS X might have to cost more. Also, I think you're only to virtualize Mac OS X Server on VirtualBox and only on Mac hardware, so no Mac OS X client on PC hardware. You need Intel VT-x. These are the instructions:

1) Go to virtualbox.org and download and install the latest version of Oracle VirtualBox.
2) Open VirtualBox, click New, give it a name and select OS Type, select Mac OS X and Mac OS X Server.
3) You can select the defaults (or more) for memory and hard drive. Note, fixed-sized storage is faster but takes up the total drive size on your hard drive regardless of how much space is being used. Finish the Create New Virtual Disk Wizard and the Create New Virtual Machine Wizard.
4) Download the EmpireEFI boot disk (search Google) (optional: also download NawCom boot disk).
5) Change the settings of the OS X Virtual Machine. Select the Virtual Machine and click the Settings button. Under System, uncheck Enable EFI. You can check Enable 3D Acceleration under Display. Click OK.
6) Click Start. For the installation media, select the EmpireEFI ISO. When you see the EmpireEFI boot screen, switch the EmpireEFI media for the Mac OS X media and press F5 (twice if necessary). Select the Mac OS X Install DVD and press Enter.
7) Select the language and click Next. Click Continue. Click Agree.
8) Click Utilities from the menu -> click Disk Utility -> select your disk from the left and click Partition from the middle bar. From Volume Scheme, choose a volume scheme (1 partition), give a name (Macintosh HD), click Apply and click Partition. Click Close.
9) Select the Hard drive and click Install.
10) The installation "fails". Restart and switch the boot media to the EmpireEFI iso again.
11) When the computer reboots, choose to boot to the Hard drive. It boots into Mac OS X, click OK and configure the keyboard. Select your region and Keyboard. Configure your account and time zone.
12) Double-click or open the Empire EFI disk in OS X, double-click Post-Installation, and run the myHack Installer. Run the installation with the defaults (Continue, continue, continue, agree, continue, install...).

To install the OS X update(s), download the full ComboUpdate and run the full download (like MacOSXUpdCombo10.6.6.dmg (if installed, remove SleepEnabler.kext). After the ComboUpdate completes, do NOT restart. Reinstall the Empire EFI. Remove the iso and reboot. Other updates work without individual downloads and without Empire EFI.

Optional portion - reboot to the NawCom iso, select the Macintosh HD and boot into OS X.

Note: You may not be able to copy to ISO (or to DVD DL) the Mac boot DVD DL. Ubuntu will do the trick, and you can use Live CD/DVD for this purpose.

Friday, August 27, 2010

VirtualPC Virtual Network Adapters in Windows (Server 2008)

I am using a set of Microsoft VHDs to demo their software (specifically Microsoft Office Communication Server 2007 R2), and I wondered why my Local Area Connection was around Local Area Connection 24 and my network card was Microsoft Virtual Machine Bus Network 15. My guess is that Microsoft passed these VHDs around for review before release, so it stored past local area connections and network adapters. The Virtual Machines had a startup script called startup.cmd that referenced a Local Area Connection that wasn't the current one. I changed the number to match mine, then decided to remove the old adapters through the registry. Here's what I did (take caution and perform backups before editing the registry):

Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\Network Cards\, network cards are enumerated by number. The Description subkey lists the name of the adapter and the ServiceName subkey lists the Service GUID. I noted the ServiceName and deleted the keys.

For Windows Vista/Server 2008 and above, the keys under HKEY_LOCAL_MACHINE\Microsoft\Windows NT\Current Version\NetworkList\Profiles represent the networks. I deleted all but the network I was interested in (the domain). The network names are listed under Description and ProfileName. Interestingly, one of the networks was corp.microsoft.com.

Under HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}, network connections are listed (like Local Area Connection n) by GUID with their names under Connection\Name. I deleted all the GUIDs for the connections I didn't want.

Under HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\Description, adapters are enumeratec and used the numbers are listed under the data of the REG_MULTI_SZ key. I cleared the data for Microsoft Virtual Machine Bus Network Adapter and Microsoft VMBus Network Adapter.

Under HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services are listed the the GUIDs representing the network cards from the ...Network Cards subkeys (ServiceName). I deleted the corresponding GUIDs from the Network Cards.

Under HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services\Tcpip\Adapters are listed GUIDs representing adapters. I deleted the unwanted keys. The same is true for HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services\Tcpip\Interfaces. I left HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Services\Tcpip6\Parameters\Interfaces alone.

I found these Microsoft Knowledge Base articles, but they apply to NT 3.5 - 4.0:
http://support.microsoft.com/kb/146333
http://support.microsoft.com/kb/147797