Monday, July 15, 2024

Windows 11 and Windows 10 iPhone Photos Need HEVC or HEIC Codec - Free Fix

 I've had multiple people ask for help when it comes to viewing iPhone photos or videos on their Windows PC. The issue is that the photo and video format the iPhone uses requires an extra piece of software for the Windows computer to decode it. Sometimes your Windows PC comes with that software pre-installed so it just works right away. But other times you are left trying to track that software down. For a while, Microsoft had that software available for free in the Microsoft Store, but they've since made it more difficult to get. However, it can still be done for free as of July 2024, and I'll explain how.

First, one disclaimer. I'm providing instructions on how you can get your links to the latest version, but through a third-party website https://store.rg-adguard.net. I have NO affiliation with that site, and am not promoting it as 100% safe. However, it appears to currently generate download links directly to the microsoft.com domain, so I believe it is safe enough as of this post, but that could change at any time.

  1. Go to https://store.rg-adguard.net/ to generate the download link to the most recent version of the codec.
  2. On the rg-adguard.net site, change the first dropdown from URL (link) to PackageFamilyName
  3. Change the last dropdown from RP to Retail
  4. For the HEVC codec, enter Microsoft.HEVCVideoExtension_8wekyb3d8bbwe in the search box. For the HEIC/HEIF codec, enter Microsoft.HEIFImageExtension_8wekyb3d8bbwe in the search box
  5. Click the checkmark to search
  6. Do not click the links in the ads. Get to the bottom of the page. Currently there usually is an ad blocking the links you actually need. Click the down arrow in the left upper corner of that (see red circled area in screenshot below) to hide it so you can see your links at the bottom

  7. Find the .appxbundle link and right-click it, then select Open in New Window. On the HEIC/HEIF image codec, you only want the appxbundle, not the eappxbundle

  8. That new window should open and just be blank. If it didn't start the download automatically, refresh that link once and it should download the appxbundle file that you need
  9. Once you have the appxbundle file(s) downloaded, close those browser windows
  10. Open Powershell on your computer
  11. For each .appxbundle you want to install, run the following in Powershell: Add-AppxPackage -Path "FullPathToFile\Fullappxbundlename". So an example command using the current HEVC codec appxbundle would be Add-AppxPackage -Path "C:\Users\admin\Downloads\Microsoft.HEVCVideoExtension_2.1.1803.0_neutral_~_8wekyb3d8bbwe.AppxBundle"
That's it. Now you should be able to view those iPhone photos or videos on your Windows PC without needing to purchase any codecs or install any third-party codecs. Make sure you run step 11 for both the HEVC and HEIC/HEIF codec files if you're planning to install both.

Friday, May 17, 2019

Mac OS X ACL file sharing permissions nightmare and how to fix it

If you've ever had to set up a file share from within Mac OS X, you may have wanted to pull out your hair. Especially if you're trying to use account from somewhere like Windows Active Directory to grant access to the shares. I've struggled with share permissions on Macs for years, especially with permission inheritance or lack of it, but think I may have finally come across the solution.

One big reason that this is such a pain is because trying to juggle POSIX and ACL permissions on a Mac is not exactly straightforward. Which one is getting used? How do they interact? I'm not going to teach you about permissions and hope that if you're reading this you at least know the difference between the two and are familiar with how each works on its own.

Another reason is that ACL permissions aren't managed very well through the GUI tools in OS X, but it's made to look like you can do it that way. However, the "Read & Write" option that's available is not the same as full access, and doesn't include any inheritance features, which is one of the biggest pieces of ACLs that people want to use. Unless you know that, which I found out the hard way, you can be left wondering why someone can't access something.

First, if you're trying to set ACLs on the Mac from anywhere but Terminal, stop. I know command line tools aren't always user-friendly, but you'll regret it if you don't set your ACLs with Terminal.

Actually, that's the biggest secret to getting this working; Use Terminal to set the permissions.

For full access, use the command

chmod -R +a "group:groupName allow list,search,add_file,add_directory,delete,delete_child,read,readattr,readextattr,readsecurity,write,writeattr,writeextattr,write_security,file_inherit,directory_inherit,execute" pathToDirectoryToSetACLsOn

just change out groupName with the group, and pathToDirectoryToSetACLsOn with exactly that, the path to update permissions on

If you're working with a domain and want to assign permissions from a domain-based security group, you have to tweak the command slightly. Instead of group:groupName allow, you can instead use DOMAIN\groupName:allow. You don't need to word group at the beginning, need to include the domain, and should separate the group from the word allow with a colon. This also allows you to use domain-based security groups that have spaces in their name.

For read-only access, use the command

chmod -R +a "group:groupName allow list,search,read,readattr,readextattr,readsecurity,file_inherit,directory_inherit,execute" pathToDirectoryToSetACLsOn

Same rules from above apply to the syntax here if you want to use a domain-based group instead of a group local to the Mac.

For your POSIX permissions on the share, you should not have a group assigned for POSIX that also has an ACL defined. That will help you avoid conflicts. For me I had a local admin as the owner (with RWX), the built-in staff group as the group (with RWX), and everyone/global set with no access. Then I used Active Directory security groups with the ACLs. I also gave the local admin group the same access via ACLs because otherwise the local admin has no access to files created by the users that were logging in from Windows devices since it was setting those users as the file owners.

If you want more info on the ACL options, you can check the man page for chmod on the Mac, or this site looks to have the details too. Once you read up on them you can decide if you need to tweak the commands at all to avoid including certain options. I also need to give this page credit because that's where I landed before being able to get this working.

Good luck




Thursday, September 20, 2018

Mac OS X apps show question marks or damaged or incomplete error

I've ran into this with individual applications over the years, and can typically solve it with either a permission repair or reinstalling the app. Today I ran into this for ALL applications for a user. You couldn't run Terminal, Safari, Disk Utility... The only thing that appeared to be ok was Finder.

I logged into another account on the machine and everything worked fine. I ran the usual disk utility commands, but no luck fixing the issue. Then I created a new account and logged in, and that account was ok too. That made me expect user profile corruption. I backed up the files, deleted the user account, then set it up again. First login and the same problem, the entire dock was question marks and nothing would run. Whatever the issue, it appeared to be directly related to this user account, but wasn't in the profile.

After wasting a bunch of additional time trying to troubleshoot this, I finally ran across the answer in the MacRumors.com forum (thank you jpete for posting it). The system folders, specifically /var/folders/, contain some cache files from user accounts. What I found is that each folder is specific to a user account, and that user account may or may not still exist in Users & Accounts. Almost like a secondary user profile area that persists even after the account has been removed. This is where the problem was. I found the folder related to the user experiencing issues by using Get Info to see who the owner of the folder was, then went into the folder named 0 (that's a zero) and deleted all the contents that it would allow me to. After rebooting I was able to login with that user account and everything was working again.

The easiest way for you to try this is to login to the account having issues and then go to Finder->Go->Go to Folder. In there type /var/folders/, then it'll open in Finder. Now go into each of the two-character folders one by one and do Get Info on the folder it contains (long alphanumeric name) until you find one that shows the username that has problems as the owner. Once you find that, go into the long alphanumeric name folder and you should be able to access the 0 (zero), C, and T folders. Do not delete those folders themselves (not sure you can even if you tried), but go into them and delete all the contents within that the system will allow you to delete. Once done, reboot the system and try logging in. Hopefully it will show you the icons in the Dock and let you run your apps once again.

Assuming you don't have Time Machine to go back to before the problem started, if this doesn't work and you have access to a 2nd account that does work on that same Mac, your best bet is to create a new user account with a different username and move your files and settings over to it from the account that has problems. Or you could back up everything and run through an installation, cleaning the drive in the process, so you have a completely fresh start.


Wednesday, June 27, 2018

OneDrive "file wasn't uploaded... changes can't be merged" error

I ran into this with a user and thought it would be a relatively easy fix by telling Microsoft Excel to discard the changes. Unfortunately it took more than that, as the changes were cached for upload to OneDrive and discarding the changes from within Excel didn't remove the cached file. OneDrive doesn't control that file cache either. Instead, it's buried within another tool called the Microsoft Upload Center. The Microsoft KB articles I found referencing it say to simply search for it, then use it to delete the cached file. It doesn't quite work that way, or at least didn't for me with the Office 2016 applications. Searching gives you no results, making you wonder if you even have the application. It's there, but you have to go the long way through Windows Explorer.

If you're having the same or a similar problem, open the Microsoft Upload Center application. You can find it within your Office installation folder. This folder is typically

32-bit Office install - C:\Program Files (x86)\Microsoft Office\root\Office16
64-bit Office install - C:\Program Files\Microsoft Office\root\Office16

In that folder you'll find MSOUC.EXE, which is the Microsoft Upload Center application. Open that and it will show you any files that are pending upload to OneDrive. Assuming the changes you made are either no longer needed, or you have them saved already in a copy of the OneDrive document, removing problematic files from here will resolve the issue where you can't update or upload to OneDrive because of merge issues. Once removed from the Upload Center, the next time you open that document it'll pull down a new copy of the file to your OneDrive cache so you can once again work on it. That also means removing the file from the cache will also discard any changes you had made to the file since the last time it was able to sync to OneDrive, so keep that in mind.

If you keep having problems, within the Microsoft Upload Center settings, you can tell it to delete the entire cache and start over. That can be used as a secondary option if selectively removing specific files doesn't work. But again, be careful if you've made changes to these documents and want to keep those changes, as deleting the cache also means the changes you've made since the last successful OneDrive sync will be lost.

Thursday, May 3, 2018

Time Machine "Can't connect to a current Time Machine backup disk"

I decided to start using Time Machine alongside Crashplan to make sure I had a local backup. Plus I'm backing up ~8TB of data on that particular Mac device so having a quick restore option makes a lot of sense.

I purchased a new Thunderbolt 3 drive with plenty of storage and set up Time Machine. Easy enough, right? It only took 2 days to get the initial backup and everything looked like it was working fine. Then I went to try a test restore and that's where I ran into problems. As I entered the Time Machine system to view what was available to restore, an error popped up saying "Can't connect to a current Time Machine backup disk". Nothing would display and I would have to exit. At first I tried a reboot, which didn't work. Then I noticed that the disk displayed a little odd in the Time Machine Preferences so I started over by reselecting my disk and waiting another 2 days for it to redo the initial backup. No luck after that either. That's when I asked my friend Google and found that I should've started there because the answer was very simple...

I had NO permission to access the time machine backup database folder! Why in the world would that be the default setting?! You can confirm that this is your issue too by going into the Time Machine disk and trying to view the contents of the Backups.backupdb folder. If you see a red no-go sign or can't view, you're having the same problem I was.

Luckily it's easy to fix, but you have to use Terminal (Application->Utilities->Terminal) because Finder doesn't seem to work to change permissions on this particular folder. Once you have Terminal open

1. cd /Volumes/TimeMachineDriveName (make sure you put the name of your Time Machine disk here after /Volumes/)
2. sudo chgrp admin Backups.backupdb

The first command just gets you to the Time Machine drive that you need to work with. The second changes the group permissions so that the admin group on your machine can access the folder and it's contents. It will ask you to enter your password after the 2nd command, which is normal when you use sudo to run the command as the root user. Once you've done this you should be able to go back to Time Machine and actually view what has been backed up, and restore files/folders when needed

Wednesday, May 2, 2018

Replace character in variable within batch script

I wanted to rename a file using a batch script so it would replace underscores '_' with hyphens '-'. It was pretty easy

Set img1=this-was_the_original-name-of_the_file
Set newName=%img1:_=-%
echo %newName%

The key to doing it is the :_=- in the second line, which is saying take the text value stored in the variable img1 and make underscores instead equal hyphens. Now, you could make line 2 instead be

Set img1=%img1:_=-%

If you don't need to reference the original value you're storing in img1 later, but for my purposes I was renaming a file so I needed both the original filename and what the new filename should be, so I had to store the new name with the hyphens in a separate variable

Thursday, March 22, 2018

Exchange Resource room only shows who scheduled in Outlook

Apparently the default behavior of resources in Exchange is to replace the subject line with the organizer's name. I'm not going to argue whether or not that is pointless, but I will tell you how to fix it. It's a simple one-line powershell command you can run.

Make sure you connect to the Exchange (or Exchange Online) Powershell, and then run


Set-CalendarProcessing -Identity resourceName -DeleteSubject $False -AddOrganizerToSubject $False

Make sure you replace "resourceName" with the actual name of your resource. Running that will leave the original subject line intact so you don't have to check the organizer's calendar to see what the meeting is about if trying to schedule a resource.

I originally found the answer in this Microsoft support article

Wednesday, November 16, 2016

iPhone missed calls showing on second iPhone

If you're sharing an Apple ID across multiple iPhones, you have likely ran into an issue at some point with one phone having something from the other phone. For this post we're talking specifically about missed call history.

If you have missed calls for one phone showing up on another phone, turn off iCloud Drive. You can do so by going into Settings->iCloud, then toggle the iCloud Drive setting to off. Make sure to verify it is off too. I've seen it take a couple tries to get it to actually go to off.

Once it's turned off the missed call history will no longer be getting synchronized, and won't show up on other phones signed into the same Apple ID

Monday, September 12, 2016

Windows 7 stuck searching for updates forever

If you've had to reinstall Windows 7, depending on how old your install media is you may run into this problem. Once Windows is installed and ready for updates, you tell it to search and it keeps searching, and searching, and searching... until you finally reboot or shutdown because it's been 5 hours and still nothing. I've ran into this a few times myself, and luckily I think I finally found a fix.

First, download and save Microsoft KB 3138612, which is an update to the Windows Update client. Apparently you now need this update to get the update process to work, but if the process is already broken then you can't get the new client through normal means and need to use the standalone installer. In my case, trying to install from the standalone left it searching forever for installed updates too, so just save this for now. You're going to need this in a minute.

Now, open up a command prompt and run it under the administrator context. The easiest way to do this would be click the Start button, type cmd, then right-click and select Run as Administrator on the Command Prompt or cmd.exe result you should see.

Once Command Prompt opens, type (without the quotes) "net start appidsvc" and press Enter. This should make sure the appid service is running.

Now that the service is running you can go ahead and install KB3138612 from the download you saved earlier. It should only take a couple of minutes to do this. If it gets stuck on searching for installed updates for more than 5 minutes, you may need to find another method. Once the KB is installed, reboot the computer.

Once the PC is on again, repeat opening the command prompt in the administrator context and starting appidsvc. After you've done that, type (without the quotes) "wuauclt.exe /detectnow" and press Enter. That should force the Windows Update client to search for updates and show you results once done.

In my case, it still took a while for it to search for updates because when it came back I had over 200 of them waiting to be installed. However, that was at most an hour. Prior to that I had left the machine searching for updates as long as 48 hrs and it never moved past that status. Once the updated client is installed, and you get past the initial round of updates that will likely be faily large, you should be fine from there to update normally in the future.


Monday, June 20, 2016

iPhone showing an unread text message but you can't find it

Ever see the notification on your Messages app, but have no luck finding it? Use Siri. Activate Siri, and then say "Read me my unread messages". Siri should then locate and read the unread message, after which the notification will go away.

I had a user that this happened to today. The odd thing was the message in question had been read and deleted already, but somehow hadn't been marked read so the notification kept coming back no matter how many times the user went into that particular message thread. Using Siri took care of it.

Tuesday, March 29, 2016

OS X Application Window not showing or visible

I recently had a user trying to open Acrobat Pro DC on a Mac laptop. The user would get the menu bar across the top, but could not see the application window on the screen to actually do anything. The trick was to go to Window->Zoom, which brought the app window back to normal on the screen. Either it has been zoomed out so much it was too small to see, or it had somehow gotten moved off the screen to where it was open but not in an area the user could see it.

Friday, December 4, 2015

Messages menu options grayed out on OS X

If you're someone that manages your fonts more than a normal user, you may have run into this issue with the built-in Messages, or iMessage, app on OS X. My users couldn't sign in or access any of the app features. The reason behind it was really simple. The AppleGothic font that normally comes on the system is required for the Messages app to work correctly. Make sure you have it activated if you're using a font manager, such as Universal Type Client. Once you have it active, open Messages and you should be able to use it like you would've expected.

Credit: https://discussions.apple.com/thread/6037163?tstart=0

Wednesday, October 7, 2015

Terminal server user cannot set default printer

Ok, I'll admit that this post is late to the party because I'm talking about Server 2003, which went EOL earlier this year. However, I'd guess that there are others like me that haven't eliminated it from their environment completely, and something similar may show up in the newer server OS versions, so here goes.

I had a couple of users who reported issues printing from their terminal server sessions. Printers were showing as installed, but if they tried to print from an application, say Excel, it would give them an error that no printers were installed and they couldn't select anything. Looking into it further, the printers were there but none were set to the default printer, and you could not manually set the default printer. Without a printer set, the applications were getting confused.

I tried recreating the roaming profiles to no avail. The printers themselves worked fine for other users and were setup locally on the terminal server. I found a Microsoft article about something similar with redirected printers that said to copy of the Default Users folder with a clean copy from another server, but that didn't seem to help either. Then I found this article. The registry hack listed there fixed it for the users that were having trouble.

Since I had regedit disabled for non-admins, I had to make changes from within a session opened by an admin. That made it a little trickier to find the correct reg key for the current user, but not impossible. What I did is expand HKEY_USERS and took a look at all the entries. Then I had the user who was having trouble login, then refreshed HKEY_USERS. Then had them logout and refreshed HKEY_USERS. It might help to do a before and after screenshot. Doing that you should be able to figure out which of the keys belong to their user account because it'll appear and disappear depending on when that user is logged in or out, and that's where you'll want to add the fix.

Have the users login, then from a session that has access to modifying the registry go to HKEY_USERS\*guid*\Software\Microsoft\Windows NT\CurrentVersion. Look for a key named Windows. If it doesn't exist, create it. Then, within Windows, create a new String value named Devices. Set the value of Devices to "winspool,Ne00", without quotes. Once done, have the user log out, then back in to your terminal server. He/She should be able to set the default printer and once again access printing services.

Monday, April 13, 2015

Export a list of categories and their parent from Magento

We were looking for a way to create a product setup form for our Magento-based eCommerce site. One of the hangups was getting a list of all our categories so that we could create a dropdown for users to select the category name from, but that we could pull the category ID from then as well. There are some posts that I found which tell you how to export all the categories with the ID value, but I didn't see anything that also told you how to get the parent category info so I had to dig into it myself. Luckily it wasn't too difficult so if you're looking to do something similar or just need a list of your category tree, you're in luck. There may be a way to do this in PHP using the some built-in functions of Magento, but I'm not familiar enough with them so I had to turn directly to MySQL. If you have an easier way please leave a comment to let everyone else know.

If you're looking at this then I'm going to guess you're a developer, or at least know someone who is that has access to the database running your site and can help you. If not then I wouldn't suggest doing this without some assistance unless it's on a test site or something other than your live site.

Within the Magento database there are two tables we need to join to get the information we're after: catalog_category_entity and catalog_category_entity_varchar. The entity table has the id values and the varchar table has the name. Now, there is a magic number used in the query that seems to vary database to database. That value is the attribute_id from the catalog_category_entity_varchar table. What I did to find out what value to use is look at the contents of the table and pay attention to the attribute_id value given to the Root Catalog entry that should be first. In my case it was 33 on one site, and 35 on another, which is why I say it varies. However, that attribute_id appears to identify the primary value field we want in order to get the correct category name, so mark it down.

The query I used to create my category list for the site where I found the attribute_id value to be 33 looked like this:

SELECT cc.entity_id,cv.value,cc.parent_id,cc.path FROM dbname.catalog_category_entity cc INNER JOIN dbname.catalog_category_entity_varchar cv ON cc.entity_id=cv.entity_id WHERE cv.attribute_id=33;

Make sure to change the attribute_id=XX; at the end to match whatever attribute_id value you found it to be within your own database. You also need to substitute your own database name in for dbname, but I'm hoping that you already knew that if you have access to the site's MySQL backend.

In this the entity_id is the ID of the category, value is the name of the category, parent_id is the ID of the parent category directly above in the hierarchy, and path is the full path in the hierarchy tree to the category based on the ID values.

I ran this query and had it export to a CSV file, and from that was able to build a drop down list to be used for selecting categories. Then we'll take products that get input into our form and upload them to the site through the use of Magmi. Hopefully this has been useful and helps you figure out whatever you're attempting to do with the categories on your Magento site.


Monday, December 22, 2014

The system has reached the maximum size allowed for the system part of the registry

The system has reached the maximum size allowed for the system part of the registry. Additional storage requests will be ignored

If you get this error on a machine it's a major annoyance. There are plenty of potential issues as to why this may be happening, but I'm not going to get into those. This article is going to assume that the registry truly has reached it's breaking point through normal means. Also, as a disclaimer, messing with your registry without understanding what you're doing is very dangerous so if you do continue with this process be careful. This article is my version of MS KB 2498915

The trick to reducing the size of your registry files is to open them within regedit without having your main OS running and exporting them. You can do this with a WinPE boot disk if the device is a physical machine. In my case the server was actually a VMWare ESXi client, and the WinPE disk wouldn't boot. In that case what I did is shut down my server and open the virtual hard drive on another ESXi client to gain access to the files.This created a new problem, but it was fixable. Make sure to check that link beforehand if you'll be doing the same in a ESXi environment.

The files you need access to are in the C:\Windows\system32\config directory: Software, System, Default, etc. These are your registry files. Whether you boot from WinPE or use a 2nd computer, those files remain the same. However, you can look at those registry files to see what their sizes are. Whichever one is the largest is the one I would suggest starting with. In my example I'll assume you're shrinking the software hive too, but you can repeat these steps for any of the registry hive files.

In my case, the software file was 3-4x larger than any of the others so that's where I suspected I had the most free space to reclaim. Once you have access to the registry files through WinPE or a 2nd computer, open regedit.

Once regedit is open, click on HKEY_LOCAL_MACHINE to select it and then go to File->Load Hive... This will open a file dialog box, and here you'll want to navigate to the registry files directory from above and open the hive, which in this case we're using software. You will be prompted to give it a temporary name, which you can use whatever you'd like to refer to it. In my case I used the name toshrink.

After the hive has loaded, select it and go to File->Export... and save it somewhere. Do not overwrite the existing hive, just in case you need it again. Something like softwarecompressed would be a good name. At this point you'll have to let regedit run, and it could take a while. My software hive was ~180MB and it ran for somewhere between 30-60 minutes before completing. Smaller will run faster of course.

After the export process has completed, close regedit and then reopen it. Once it is open again, click the hive you loaded in HKLM and go to File->Unload Hive... This will unload it from the registry.

Now go to the location of your newly compressed hive file. In our example we have softwarecompressed, which should be smaller than the software hive we started with. Rename software to software_orig, and rename softwarecompressed to software. Place the compressed and newly renamed file into the C:\Windows\system32\config folder and then reboot your machine normally. This should load the system with the compressed hive file, and get rid of your maximum size allowed error.

For me the software hive was 192MB, and after this process it was 133MB. The other hives didn't shrink enough to make it worthwhile, but the compression on the software hive was significant.

Good luck


Wednesday, December 17, 2014

VMWare error: The parent virtual disk has been modified since the child was created

I needed to shrink the registry files on a ESXi guest (guest1), and in order to do so I shut it down and mounted the virtual disk on a separate ESXi guest (guest2). Once it was done, I removed the temporarily shared virtual disk from guest2 and went to boot guest1. I received an error that said "Cannot open disk: .... The parent virtual disk has been modified since the child was created". I then tried reverting to a snapshot and that failed, so for a minute I thought I may have just lost one of my servers. Fortunately this is something that can be fixed, and it wasn't too difficult.

The ESXi guest's virtual hard disk can consist of multiple files. What was happening is that the ID tag(s) saved in those files to tell the system which order to align those files in to create the complete hard disk were getting changed when I mounted it on guest2. To fix the problem I needed to sort through those virtual disk files and correct any mismatched ID tags. Here's how I did that

First, I had to enable SSH access to my ESXi host. You can also get in through the ESXi CLI too if you'd prefer. To enable SSH access to an ESXi host, you can do it from the direct console or from the vSphere Client. From the direct console, log in and go to Troubleshooting Options->Enable SSH. To enable it through the vSphere client, open the host and go to Configuration->Security Profile. Then in the Services section, click Properties, click on SSH, then Options. From there you can set the startup policy, and also start the service.

Once I had SSH access enabled, I logged into the host holding guest1. Now you want to get into the datastore where the virtual hard disk files are stored for the guest, and navigation commands are the same as you'd use in Linux. For me it was cd /vmfs/volumes/datastore1/guest1. Once I was in that directory I could use the ls command to list all the files. What I needed where the guest1.vmdk, guest1-0000001.vmdk, guest1-000002.vmdk, etc files. For my machine, I had guest1.vmdk, and then three add-ons, so four total virtual disk files to look at.

At this point you'll want to use your favorite text editor to open these files. Personally, I use vi, but you can use whatever you'd like that is available. Open each of the virtual disk files and note the value at the top for CID and parentCID, then close and move to the next. The parent CID of guest1.vmdk should be something like ffffffff. Once I had opened each of my files I had this


guest1.vmdk
CID: 32b76102, parentCID: ffffffff

guest1-0000001.vmdk
CID: 7d3d984f, parentCID: fa1f4813

guest1-000002.vmdk
CID: 49eb6c66, parentCID: 6e1b350e

guest1-000003.vmdk
CID: fa1f4813, parentCID: 49eb6c66

Now is where you get to solve the puzzle. Which CID or parentCID is incorrect and screwing up your virtual hard disk? I had to draw it out, but what I ended up with is

6e1b350e (???)<-49eb6c66 d3d984f="" fa1f4813="" guest1-000001="" guest1-000002="" guest1-000003="" p="">
For me it was that the parentCID value on guest2 was pointing to an unknown CID. Once I found that out, I opened guest1-000002.vmdk in vi and changed the parentCID value to the CID value of guest1.vmdk, 32b76102. Saved and closed, then booted up guest1 without any other problems.

I did try it a second time just to see, and in that case the same thing happened on the same file. It looks like when I mount the virtual disk in guest2, the CID value on the primary vmdk file gets changed. All the others stay the same, so if you can find the parentCID value that is going nowhere and change it, then you're back in business.


Articles I found that helped me come out with the solution

VMWare KB about hard disks failing to open

VMWare KB about resolving CID mismatch on virtual hard disks

Enabling ESXi Shell or SSH access to ESXi host

Editing VMWare config files

Monday, June 30, 2014

Install Symantec's Backup Exec 2010 Mac OS X agent in OS X 10.9 or 10.10

Updated: 10/23/15

I reinstalled the OS on my OS X server and upgraded to 10.10 Yosemite. In that process I had to reinstall the Backup Exec agent, and I'm still running 2010. It was quick and simple, even though I ran into the same error about Switch.pm missing. Since it's been so long I looked it up rather than referring back to this post, and found an easier command than below on this blog. In Terminal, run sudo cpan -f Switch. You'll likely get a message that says something about your system needing XCode installed, and you'll have to select Install. Once that finishes, re-run sudo cpan -f Switch and let it autoconfigure itself. Once done, go ahead and run the Backup Exec Agent installer and any service packs you have for it and it should work just fine. Make sure to start the agent when you're finished.

Original Post:

If you're like me and hated the newer interface Symantec introduced in Backup Exec 2012, you may still be running Backup Exec 2010 instead. Now, if that's the case and you introduce a new Mac running OS X 10.9 Mavericks into your list of machines to backup you're going to run into a problem. The BE2010 agent will not install in OS X 10.9 and will give an error message instead about not being able to locate Switch.pm. Before you jump to the conclusion that you need to upgrade Backup Exec to a version compatible with OS X 10.9, keep reading.

I ran across this today with a new OS X 10.9 Mac Mini server. It turns out that in Mavericks the Switch.pm has been deprecated from the version of Perl that comes with the OS, and the RAMS agent installer relies on that to run. It also turns out that adding it back to the OS is a pretty simple process, and once done the RAMS installer runs just fine. Here's what I did

1. Open a Terminal window on the OS X server
2. Run the command cpan install
3. Follow through the on-screen setup for CPAN (Comprehensive Perl Archive Network). I used the defaults
3a. During the install you will be prompted by the OS that you need to install make in order for the installer to continue. Click OK and let make install
4. Now CPAN should be installed so start it with sudo cpan. You need sudo access to install the Switch.pm file
5. You should see cpan (1) >. Type install Switch and press Enter. This will install the missing module back
to your Perl library
6. Once that's done type quit and press Enter to get back to the main Terminal

Now you should be able to run the RAMS installer package normally, and this time it should work.

Before doing this though, you should really ask yourself if you should. It seems to be working fine for me, but the Switch module was deprecated and left out for some reason. I make NO guarantees about this process, other than that it worked for me. If you have a test network available, please make sure to utilize that first before making this change in your production environment. Like I said, this was figured out the same day that I posted it, so I haven't done enough testing to say that it won't adversely effect the system, RAMS performance, or both.

This is the original article I came across while trying to get the RAMS installer to work that led me to write this article.

Monday, June 9, 2014

Free up inactive memory in OS X

Let me preface this by stating that normally you should not have to do this, and it is typically best to let the OS manage the RAM usage. I suggest you use this method only when necessary rather than as a standard practice. I'm also making an assumption that your familiar with the Terminal app, primarily in the situation where you want to schedule this. If you are not, you may need to do some research on Terminal outside of this post.

If you're like me, you've had an issue on an OS X server and when you check it out there is little to no free RAM available but you have a bunch stuck in the state known as inactive memory. This typically indicates one of two things. Either you need more RAM to run your server applications effectively, or something is causing a memory leak. In my case it is a little of both. However, running out and picking up Apple Server memory on a whim isn't always an option. Tracking down a faulting program isn't always easy, or quick either. If you're struggling to keep an OS X server accessible while waiting for an upgrade window or to give yourself time to troubleshoot, or if you're having problems with the personal Mac's memory allocation, this may be a temporary workaround you can use.

There is a command named "purge" that will free up the inactive memory. You can read more about it on the purge man page. You can simply open Terminal and issue the command, then press Enter. You may need to use sudo purge, but nonetheless you can invoke purge and free up some RAM immediately.

However, if this is a server or continues happening, you may want to script this command and call it on a schedule. While waiting for a shipment of RAM for a couple OS X servers having this issue, I used this script provided by Daniel Payne on stackoverflow.com in this article.

#!/bin/bash
free=`vm_stat | grep free | awk '{print $3}'`
freer=${free%%.*}
if [ "$freer" -lt "18000" ]
then
    nice purge
fi

I opened Terminal and used vi to create the script file, but you should be able to use Textedit or any text editor you'd like. Just make sure to name it with the extension of .sh at the end, so your file should be named something like freeRAM.sh. What this script does is run the purge command if there are less than 18000 free memory pages available. You will want to modify that value to match the minimum amount of memory you will accept before running the command. This eliminates unnecessary running of the purge command. Remember that this is the value in memory pages, not B/KB/MB/GB. If you don't know page size your system is using, you can run vm_stat within Terminal and it will tell you in the first line. For my server I was using the default page size of 4096 bytes. This means that if I wanted to run the purge command if there was less than 200MB of free memory, I would need to substitue the 18000 in the script above with

200MB * 1024KB/1MB * 1024B/KB * 1PG/4096/KB = 51200 (instead of 18000)

Once you have your shell script saved you need to add it to the schedule. You can use cron, but it appears to be deprecated in newer version of OS X so instead we'll use launchctrl. I used the guide found here to create my .plist file and get it into the launch daemons schedule.

You can also create your script using Automator and then schedule it using iCal. However, I wanted to run the script multiple times a day, and it appears that using iCal allows once a day as the most frequent option.

Monday, May 19, 2014

OS X Active Directory Users losing admin privileges when offline

For anyone using Directory Services in OS X to bind the Mac to a Windows domain, you've likely seen the option to allow administration by..., where you can define groups to administer the machine. I have a security group setup in Active Directory specifically for this, and whenever I bind the Mac to the domain I add that group and turn that option on. However, once in a while, when a machine is not able to directly authenticate with an Active Directory server, domain users do not have local admin rights. Typically admin rights come back the next time the machine is able to communicate with Active Directory, but in the meantime it is an annoyance while offline. Fortunately, it appears that I'm not the only one who has been dealing with this. I only wish I had spent some time researching it sooner.

Previously, my workaround to this problem has been to remove the Mac from the Active Directory domain, and then rejoin. While this has worked, it is just a workaround rather than a solution. It appears that someone with the same issue has found the actual problem, and also posted the solution. What is apparently happening is that even though those groups are supposed to be allowed to administer the computer according to the setting in Directory Services, the accounts are not added to the local admin group on the Mac. You can fix this by opening a Terminal session, and running the following command:

dseditgroup -n /Local/Default -o edit -u localUsername -p password -a accountToAdd -t user admin

*UPDATE*

Rather than use the above command, I found simply using sudo removes the need for the -u and -p switches so you can use the following.

sudo dseditgroup -n /Local/Default -o edit -a accountToAdd -t user admin

-n = node
-u = local username used to authenticate to make the change
-p = password for user defined with -u
-a = name of account to add to the admin group
-t = type of account you're adding
admin = group name

You'll want to use your own information for -u, -p, and -a. -t can take group as an option (instead of user). I haven't tried that yet, but it should allow you to add an entire security group to the local admin group in case you have multiple users for that one machine

Now, I believe this may do the same thing as well if you're not comfortable using Terminal to issue that command. You'll need to have login info for an actual local admin account, and the domain account you want to grant admin rights to must have logged in to the machine at least once already. Simulate being offline by turning off the wifi connection and disconnecting any LAN cable(s). Once you're offline, go into System Preferences->Accounts, click the user that should have local admin rights and check the box that says "Allow user to administer this computer". Then reconnect your network connection and reboot.

The two articles I found related to this that I used are:

https://discussions.apple.com/message/16026679#16026679

https://discussions.apple.com/message/22540531#22540531




Wednesday, May 14, 2014

ProcessExplorer "Unable to extract 64-bit image" error

The ProcessExplorer program is a very useful utility. I needed it today to track down a file lock, but upon trying to run it on my Windows 7 64-bit machine, I kept getting an error telling me "Unable to extract 64-bit image...". A few Google searches mentioned this being caused by a permissions error, but this didn't make sense since I'm an admin on the machine. After I ran across this on the SysInternals forum, then I realized that those saying that permissions were the problem weren't wrong, but that their answer wasn't specific enough.

Upon running the ProcessExplorer executable, it will extract the 64-bit version of the program to the AppData/Local/Temp folder and attempt to run from there. However, if you're like me and have restrictions on applications running from the Temp folder, this will cause the error. To get around it I simply navigated to my temp directory and move the procexp64.exe file to my Desktop and executed it from there. It opened right up and I was able to get back to what I needed ProcessExplorer for.

By default the AppData directory is hidden. The quickest way to get there is by clicking Start, then type %tmp% into the Search box and press Enter. Or type the path directly into the navigation bar, or choose to show hidden files.

Full path to the temp folder is C:\Users\"your username"\AppData\Local\Temp