Steps to install WordPress on Azure Virtual Machine running Ubuntu

I have moved my blog to Azure Website for a while and I am quite happy with it. However, recently I have decided to move my blog to an Azure VM running Ubuntu.

I have to say Azure Website is very fast, convenient and easy to set up: you just have to create a new website, chose the WordPress template and go though the WordPress’s 5-minute setup. However, that require you to scale up to Shared, Basic or Standard plan (which cost at least 10 USD/month) to get some more advanced features such as setting custom domains. Besides, the free MySQL database by ClearDB provides you with only 20MB, and the cheapest upgrade is another 9 USD/month for 1GB (quite huge for my blog).

Recently, I happened to create a Ubuntu VM for my research. And most of the time the VM is idle. So instead of turning it on an shutting it down all the time to save cost, I decided to move my blog again to the VM, and buy a new domain for it: www.nguyenquyhy.com.

However, setting WordPress up on a Virtual Machine with Ubuntu 14.04 is not really as joyful as on an Azure Website. It cost me almost 3 days to solve all the issues, so I decided to note down all the steps I take here in case I need to move my blog again in the future, or someone else gets the same problems.

Read the steps

One more way to setup NTU’s VPN in Windows 8.1

If you are working or studying in NTU (Nanyang Technological University), you may want to connect to NTU’s VPN from home sometimes (for some remote desktop for example). I have tried to follow the instructions at http://www.ntu.edu.sg/cits/itnetworking/remoteaccess/Pages/quickstartguide.aspx. Those methods works great on Windows 7, Windows 8.0 and Windows 8.1 as well. However, I don’t really like to install Juniper or NTURAS VPN on my laptop, mainly because it is already very messy and I don’t want to make it any messier, so I tried to setup a VPN connection manually and now it becomes so convenient connect.

Continue reading the instructions

Windows Store and error 0x80080206

Recently I have reinstalled Windows 8.1 on my laptop and had to reinstall all Windows Store apps. The process with Windows Store apps is much easier than reinstalling “legacy” Desktop app. Basically you just have to go to the Store app, right click to open Navigation bar and choose “Your apps” to see all the apps that you have installed on any of your Windows 8 (and 8.1) devices.

You can choose every app you want to reinstall, then press Install button and let the store do the rest.

In Windows 8.1, you can also click on the “placeholder” tiles on your Start Screen (those with the download icon on the bottom right corner). And the app will be downloaded right away. Pretty neat when you want to restore all the app on your old Start Screen.

The experience is definitely much better than reinstalling Desktop apps before except that the Store sometimes throws out error with strange (and useless) error code, preventing you from installing your apps. Many of them usually disappear after you install all the updates after installing Windows. However, one of them remain no matter how much I tried: 0x80080206.

The Journey

So you can skip this and go directly to the next part if you just want to solve the problem, but I will list out everything I have tried, maybe it can help me in the future with another one.

When the Store has some issues, I will first try to reset it by simply call wsreset.exe from an elevated command prompt (right click Start button, choose Command Prompt (Admin) and type in wsreset.exe and enter). Unfortunately this did not solve my problem.

I then try to search for the problem code on the internet. I could not find any working answers for this, but I found out where event logs of the store reside, which was very valuable in this case (for those kind of errors, the event logs usually show much more information about the problem). So you can open Event Viewer, and go to Applications and Services Logs/Microsoft/Windows/AppXDeployment-Server/Microsoft-Windows-AppXDeploymentServer/Operational. Those logs were very details about each step the Store took to install an app (including error logs and information logs as well). So what did it say about my problem? Here are the 2 error logs:

Deployment Stage operation on Package GAMELOFTSA.Asphalt7Heat_1.0.2.1_x64__0pp20fcewvvtj from: (x-windowsupdate://6AEE2A89-893B-4620-96BB-E4DE8F907FBD/45223cd2f4f5e6ed57fd4a1d5e8ad2714b7ceba4) failed with error 0x80080206. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.

error 0x80080206: AppX Deployment operation failed. The specific error text for this failure is: Deployment Stage operation on Package GAMELOFTSA.Asphalt7Heat_1.0.2.1_x64__0pp20fcewvvtj from: (x-windowsupdate://6AEE2A89-893B-4620-96BB-E4DE8F907FBD/45223cd2f4f5e6ed57fd4a1d5e8ad2714b7ceba4) failed with error 0x80080206. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.

I could not believe why all those information did not show up directly in the Store. It was astonishing that there was a link to troubleshoot the problem, but hidden deep inside a place where the general users could never reach.

Jumping to the link, I saw all the information about the problem including error code (APPX_E_CORRUPT_CONTENT), value (0x80080206) and description (The package contents can’t be read because it’s corrupted), but again, the solution was totally missing!

At least then I could guess that the problem was caused by the corrupted installation files, so I needed to clean this up and try again. I tried to look at several places, including C:ProgramDataMicrosoftWindowsAppRepository and C:Program FilesWindowsApps (you will need to go to security tab of those folder and change the owner to yourself) but the app or the installation file was not there.

And then I tried another suggestion, deleting (or renaming) this folder C:WindowsSoftwareDistribution. This is actually the place where the installation files are stored until the app is installed, however, I could not rename the folder because something was still accessing this. I decided to go inside and rename the folder Download instead (you should close all the running apps, and run wsreset first). Amazingly, the problem was solved! I had to redownload the app, but the installation worked without any hiccup.

The Solution

In brief, the error code 0x80080206 means “The package contents can’t be read because it’s corrupted“. So you can solve this by renaming or deleting the folder C:WindowsSoftwareDistributionDownload. The folder could be locked by some running apps (especially the Store), so you should try in Safe Mode or run wsreset and close the Store completely before trying. You will then have to download all those problematic apps again, but the issue should be away now.

Conclusion

I really think that Microsoft should show up the description of the error directly in the Store instead of a webpage on MSDN. Seeing the description of a problem might not help you to solve the problem, but it is much easier to ask for help in English rather than in mysterious error codes!