vrijdag 14 juli 2017

CyanogenMod 13 Hyper-V Virtual Hard Disk


So, I configured a CyanogenMod 13 Android Hyper-V VM using the cm-x86_64-13.0-r1 iso from the Android-x86 project. I'm sharing the setup specifics and hard disk primarily for my colleagues. Of course there are other Android VMs available for e.g. Oracle VirtualBox or VMware Player, but that makes it impossible to simultaneously run Hyper-V VMs. The hardware virtualization technology (IntelVT/ AMD-V) is already claimed. This setup fixes that.

Filesize:5GB
data.img: 3GB (user data)
Filesystem: NTFS
Partitioning: GPT

You have to navigate the Android CM13 factory boot welcome menu before you can fix the mouse integration issue (read: Limitations). Use the keyboard navigation keys to select.

Create the Hyper-V VM


You need to create a generation 1 Hyper-V virtual machine, because the Android-X86 kernel doesn't support booting a hard disk from a SCSI controller. On my Windows 10 (version 1703) the VM breaks when I remove the SCSI controller. Advise: leave it.

Memory: e.g. 2GB, disable Dynamic Memory 
Processor: e.g. 1
IDE Controller 0: attach yourvm.vhdx
Network Adapter: Connected to a Virtual Switch with DHCP servicing.
No legacy network adapter required.
Integration Services: All services
Boot from IDE.

Edit the GRUB menu


Mount the virtual disk to a driveletter by double-clicking the vhdx file. Edit \grub\menu.lst and append vga=ask at the end of the first kernel execution line. When you choose the edited GRUB entry, after starting the VM, you will be able to choose a screen resolution e.g.: j. If you want to make your resolution preference permanent, replace the vga=ask with the decimal equivalent of the hexadecimal value. For example. j = 32B = 881. I changed vga=ask to vga=881. You can use an online hex to dec converter.

GRUB video modes

GRUB menu.lst

Limitations

  • SU application permissions don't stick.
    Not fixed in latest release (Android-x86 7.1-rc1).
  • Hyper-V mouse integration doesn't work.
    Open Developer Options by clicking Settings > About phone > 7x click Build number > Enable Root Access & Local terminal. Launch terminal, su, rmmod hid_hyperv.
  • ADB over Network doesn't work, probably because Android WiFi is disabled.
    The VM uses a different nic to connect to Hyper-V. I'm am using FTP Server for file transfer. E.g. FTP Server Ultimate doesn't work because it needs WiFi enabled.
  • No clipboard sharing between host and Android client.
    I am currently using Alt-C to mitigate this. My preferred tool (ClipSync) needs WiFi.
  • The on-screen keyboard appears, but you don't need it. A solution is Null Keyboard.

zondag 5 maart 2017

Display new and old style Windows OS versioning in PowerShell

The program winver.exe (About Windows) displays Windows OS version information by combining registry data values. I wrote a small PowerShell script to show the differences between the new (=> v10.0) and the old (<= v6.3) OS versioning format. Tested on Windows 8.1, Windows 10 and Windows Server 2012 R2.

W10 winver.ps1
W10 winver.ps1
The variable MMBR strings the major, minor, build and revision number together. If the registry has no entry for the major or minor number, the missing value in MMBR is shown as EMPTY. If the major and the minor value are both missing, they get replaced by the old version number.

W12R2 winver.ps1
W12R2 winver.ps1

winver.exe
winver.exe old and new versioning

winver_0.2.ps1:

# Ron Bos, rethinkit.nl, 2017, v0.2
write-host `
`n"Edition:"(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').ProductName `
`n"Version:"([String]$Version=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentVersion)`
`n"Release:"(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').ReleaseID `
`n `
`n"Major:"([String]$Major=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentMajorVersionNumber) `
`n"Minor:"([String]$Minor=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentMinorVersionNumber) `
`n"Build:"([String]$Build=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentBuild) `
`n"Revis:"([String]$Revision=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').UBR)

if (($Major) -and ($Minor)) {
$MMBR=(echo MMBR : $Major"."$Minor"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (($Major) -and !($Minor)) {
$MMBR=(echo MMBR : $Major"."EMPTY"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (!($Major) -and ($Minor)) {
$MMBR=(echo MMBR : EMPTY"."$Minor"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (!($Major) -and !($Minor)) {
$MMBR=(echo MMBR : $Version"."$Build"."$Revision)
write-host $MMBR -ForeGroundColor green
}
pause

vrijdag 23 september 2016

Apple's Home Sync is depricated in macOS Sierra

Apple's Home Sync is depricated in macOS Sierra (10.12). Therefore I am implementing a Mac server app Time Machine repository for use with Mobile accounts and Local home folders.

I'm posting my Home Sync configuration here before deleting the current setup.

A Custom Settings payload in Profile Manager to battle the conflict errors and bugs:

Custom Settings plist: com.apple.homeSync

Open Directory configuration for OS X <= 10.6:

MCXFlags.txt


MCXSettings.txt

The MCXSettings consists of the creation of a Mobile account at first login and the  com.apple.homeSync.plist.