Featured

Asking questions, following them up

Hello Guys

Not all situations, however for certain interesting cases, I spend loads of time out of my professional and personal life to nail down the concerns, situations you highlight through the comments and I feel neglected and insulted when YOU don’t respond to my queries on timely manner. No, it doesn’t mean I am not going to respond to your specific questions, however I may not follow up the progresses you have made unless I see a keen involvement.

Further, many instances I contact you through the emails provided with your comments and other than 1-2 instances, I have never received replies. I send you emails to insure that your private information are not being visible through the comments area. Hence, please make sure that you will be using regularly used email accounts while commenting or asking questions.

Please follow the below guidelines if you are keen about getting answered

  • Provide me an email address that you are frequently checking
  • Regularly check for the comment replies (You get a notification on email when I reply to your comment)

If I am not supported by YOU as the initiator, please be informed that, I do have better things to do :)

Sorry for the “Attitude”, however, that is going to save me some precious time!

regards,

 

 

Featured

Windows7bugs | Script Copying Instructions

Hello guys

Once in a while we receive complaints about scripts copied from our blog causing issues. We regret those issues and apologizing to everyone who suffered due to. Our blog is totally free until date and unfortunately, different browsers behave differently while parsing the code tags.

We were using

 [ code ] [ /code ]

tag for long time, found that few scripts getting totally messed up with double quotes being showsn and &quote etc. This has forced us to start using

[ sourcecode ] [ /sourcecode ] 

and realized if we have more than one block of scripts, the 2nd and consecutive scripts blocks being totally garbled.

With reference to above said, we request you to kindly make sure that the scripts those you copy from our posts are thoroughly checked for special characters prior applied. Especially registry related scripts as such attempts could completely wreck your Windows registry databases.

We hope you read us clearly and continue supporting us.

Regards,

Windows 10 | Surround Sound & VLC Player

Hello guys

One of the most complicated “problems” I have had with Windows 10 was, using built-in “Movies & TV” instead of my favorite VLC Player, just because the later “fails” to play 5.1 surround sound, which I love

It looks like Microsoft Windows “Movies & TV” by default enables HDMI audio passthrough, thus surround sound is channeled rightfully.

Let us see a typical scenario:

  • Your PC is connected to a SmartTV that has Android TV (on HDMI Port 2)
  • Your TV is connected to AVR on ARC using HDMI (on HDMI Port 3)
  • Your PC shows your TV as your default “Speaker”
  • You setup 5.1 surround sound (unfortunately, you cannot test the setup us Windows doesn’t do the HDMI audio passthrough, instead the applications those are equipped with HDMI audio passthrough)

You try to play your video clip that has AC-3 6 channel audio, using VLC. What you hear is stereo only & toggling through the AVR’s different Audio formats do not do anything.

Now, here is the catch. By default VLC doesn’t enable HDMI passthrough. If you are using VLC 3.x.x versions, you can easily turn on the HDMI audio passthrough from Tools ->Preferences -> Audio

Select either “Enabled (AC3/DTS only) or Enabled. Switch to the one works for you.

Try to play the video again. One of the interesting factor I recognized that, once the HDMI/SPDIF audio passthrough enabled, VLC doesn’t care whether your speaker setup is surround (5.1, 7.1, x.x) or not. It just does the audio channel routing.

Try and let me know whether it works for you.

regards,

rajesh

Install Oracle forms & reports 12.2.1.4 with Weblogic 12c 12.2.1.4

Hi guys

This time we are going to see how we could install and configure Oracle forms & reports 12.2.1.4, the latest version using WebLogic Server 12c 12.2.1.4

Download Software from Oracle

Fusion Middleware Infrastructure Installer (Weblogic)

https://www.oracle.com/middleware/technologies/weblogic-server-installers-downloads.html

Oracle Forms & Reports 12.2.1.4

https://www.oracle.com/middleware/technologies/forms/downloads.html

JAVA SE Development Kit 1.8

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install JDK

I prefer installing JDK on C: drive & Usually my JDK is installed on C:\Java\JDK folder. The shortest name, the best to handle it later. Once the 64Bit JDK is installed, you need to setup either JAVA_HOME environment variable or add a new entry in to the system path. I prefer a system path modification than user path modification.

Okay, there are hell loads of Oracle software installed on my system. Don’t worry, I manage them. Just make sure the JDK installation path is on top of the list and you are good to go

Install Weblogic Server 12.2.1.4

It may take a while for the jar file to extract and start the installer. Please wait patiently. I was setting up the entire infrastructure using Windows 10 VM & due to the limited resources, hence the entire ordeal was kind of time taking this time for me.

You can safely skip the Auto Update

Naming Oracle installation folders is an art. The complex the folder structures, the complex later configurations would be. I usually prefer to install all my Oracle software on D: drive. Please feel comfortable to format the Oracle home as per your requirements. Maintaining the same format helps me to locate and sometimes replace files from previous installations.

Select “Fusion Middleware Infrastructure”

WebLogic or Middleware installation is NOT complex anymore on Windows 10 OS. There are no special hacks needs to complete the installation.

Install forms & reports 12.2.1.4

Extract the downloaded zip file & you MUST start the installer as “Administrator”.

We’ve to install the Forms and Reports stack on an existing Oracle Home. So please select the Oracle Home where you have installed “WebLogic” Server. Alternatively you can always install the stack on a different Oracle Home, which I never tried earlier.

Select “Forms and Reports Deployment”, as the last two versions of Forms & Reports allow you to install a Standalone Forms Builder.

Select the correct JDK Home

Please make sure that you have Visual C++ libraries pre-installed prior proceeding. If you don’t have the VC++ libraries installed, the OHS instance will not start & you might experience additional problems during installation also.

That completes the Forms & Reports 12.2.1.4 installation.

Create a REPO for the Classic Domain

To create a classic domain, you must have a repository available with the database. Weblogic 12c supports Oracle 11G 11.2.0.4 or later database for the repositories & my pick will be always 12c Database as the 11.2.0.4 is only accessible for customers with valid Oracle support. You may refer this document for a detailed “how to” towards installing Oracle 12c database.

From an elevated command prompt, switch to Oracle Home\oracle_common\bin folder & execute “rcu.bat”

Check the below image for details

Choose the defaults

Provide the connection parameters. If the database is on another server, you don’t have to install additional clients, connection parameters will take care of the connection. Refer the below image for details (Adjust according to your database setup)

My 12c Database already has a repository for Forms & Reports 12c 12.2.1.3, hence I created a new prefix “DEV1”. If you are creating a repo for the first time, you can use “DEV” or any other 3 letter combination (make sure you will able to remember it laters).

Select all the components as seen with the below image. The selected are mandatory, especially the Metadata Services.

Use the same password everywhere! Unless you are setting up a production instance, use the same password everywhere. Example, I use “Abc1234” for the schemas, Weblogic Admin account, node manager etc, which makes the administration much easier. For production, follow the Oracle standards.

That completes the repository creation for a Classic domain.

Create a Classic Domain for deploying forms & reports application

From an elevated command prompt, switch to Oracle Home\oracle_common\common\bin (eg: D:\Weblogic\Middleware\Oracle_Home\oracle_common\common\bin) & execute config.cmd, that will kick start the classic domain configuration wizard.

Select the defaults, unless you have specifics. We will be creating a new domain with the following example.

Refer the below images and select the same components for a successful domain creation for forms and reports.

As I mentioned earlier, use the same password here, so that you don’t have to worry about forgetting & recovering it at later stages.

We will setup the domain for production (never tried Development, so don’t know how exactly both differ from each other). Leave the JDK selection as it is.

Now, your earlier created repository will come in act. Refer the below image(s) and adjust as per your environment

Make sure all the Schema validations are successful. Next step select components as per the below image

Make sure the Server Group is filled the value as seen with the below image. Don’t miss it!

We’ll add an instance OHS now. Click on the add button and refer the below images for more details

Fill in the Listen Address with “localhost” and leave rest to defaults

That finishes the creation of your classic domain.

You should able to access the newly created WebLogic admin server through the URL http://localhost:7001/console

I’m hurrying to publish the POST without further delays, as I am once again caught up with multiple assignments & keeping up with promises are NOT something I am look up to at this time. However, I will add up the missing configurations for OHS and setting up the Forms and reports very soon an an annexure as early as possible!

regards,

rajesh

Windows 10 |The device is being used by another application

Hello guys

Greetings! Yes, I know it was a long break. Trust me, I wanted to post many things, couldn’t as I was too busy (doing my actual job, traveling etc ;) )

Anyway, Windows 10 is never packed with less surprises. Recently I was going through a 4K video clip with multilingual audio tracks & realized that the much celebrated VLC player cannot play it, when the default Movie & TV windows app played the clip without a single break or lag. However, as soon as I tried to switch the default language from “Arabic” to “English” I started getting the error “The device is being used by another application” & the app stopped playing the video (lands on the gallery actually)

I was lucky enough to land on a page with correct solution. https://blog.pcrisk.com/windows/12516-how-to-fix-the-device-is-being-used-by-another-application & “Disable Allow Applications To Take Exclusive Control Of This Device Option” section helped me to finally get over with this major annoyance. Not just that, once done, the app remembers the audio track that you selected & plays the same when you open the same video clip next time! unlike VLC player.

If you landed on this page, looking for a solution, please go through the blog from pcrisk.com & they have multiple solutions to this issue and one of the solutions listed there should help you also.

Hope it helps few out there!

regards,

rajesh

Weblogic 12c | Admin Server startup error(s)

Hello guys

Two days back I’ve seen a tweet from Michael Ferrante asking the “Forms Enthusiasts” to hold their breathe, as Oracle is going to announce something “Exciting” for Oracle forms. Are you EXCITED as much I am? Well, I am pretty sure, it is going to be a push for AuraPlayer, as he has mentioned them in the tweet.

Regardless, I’ve a local instance of Weblogic Server 12.2.1.3, installed and a classic domain created. I stopped using it as my firm decided to drop the idea to migrate our 20+ years old Developer 6i developed ERP to Weblogic due to the complexity of Oracle licensing, followed by the uncertainty of Oracle support for Oracle forms beyond 2025 (Which is just 6 years away).

Hell with it, I wanted to see how far I have configured the domain and ended up setting up the forms server, publishing the half baked legacy application. As I have made more than dozen Weblogic installations in last 2-3 years time, I had almost everything backed up from different installations like configuration files, environment and registry files. All I needed was to copy and replace them at most of the places to bring the legacy application online within couple of hours time.

However, I have noticed that while starting the Weblogic Admin Server (from the command prompt, using supplied .cmd files), I was getting a number of java errors & all of them were related to FADS (Forms Application Development Services) & some text were like below (Sorry for the wrapping issues)

weblogic.application.library.LibraryDeploymentException: [J2EE:160141]
Could not initialize the library Extension-Name: fads-dbtools-library.
Ensure that the deployment unit is a valid library type (WAR, EJB, EAR, plain JAR).
D:\Weblogic\Middleware\Oracle_Home\forms..\sqldeveloper\sqldeveloper\lib\oracle.dbtools-common.jar
(The system cannot find the file specified) with :
D:\Weblogic\Middleware\Oracle_Home\forms..\sqldeveloper\sqldeveloper\lib\oracle.dbtools-common.jar
at weblogic.application.internal.library.LibraryDeploymentFactory.getLibData(LibraryDeploymentFactory.java:98)
at weblogic.application.internal.library.LibraryDeploymentFactory.createDeployment(LibraryDeploymentFactory.java:50)
at weblogic.application.internal.DeploymentManagerImpl.createDeployment(DeploymentManagerImpl.java:195)
at weblogic.application.internal.DeploymentManagerImpl.access$800(DeploymentManagerImpl.java:61)
at weblogic.application.internal.DeploymentManagerImpl$DeploymentCreatorImpl.createDeployment(DeploymentManagerImpl.java:628)
Truncated. see log file for complete stacktrace

weblogic.application.internal.DeploymentStateChecker$DeploymentAssertionError: Unexpected transition: current state for application fads#1.0 : STATE_NEW attempt to transition to STATE_ADMIN
Dumping 2 callbacks
———————- BEGIN CALLBACK DUMP ——-
java.lang.Exception: prepare
at weblogic.application.internal.DeploymentStateChecker.save(DeploymentStateChecker.java:152)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:157)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65)
at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:166)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:41)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:193)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:31)
at weblogic.management.deploy.internal.ConfiguredDeployments$2.doItem(ConfiguredDeployments.java:741)
at weblogic.management.deploy.internal.parallel.BucketInvoker$2.run(BucketInvoker.java:95)
at weblogic.work.ContextWrap.run(ContextWrap.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:670)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
java.lang.Exception: activate
at weblogic.application.internal.DeploymentStateChecker.save(DeploymentStateChecker.java:152)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:164)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:274)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:507)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:53)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:202)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:52)
at weblogic.management.deploy.internal.ConfiguredDeployments$2.doItem(ConfiguredDeployments.java:741)
at weblogic.management.deploy.internal.parallel.BucketInvoker$2.run(BucketInvoker.java:95)
at weblogic.work.ContextWrap.run(ContextWrap.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:670)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
———————- END CALLBACK DUMP ——-
at weblogic.application.internal.DeploymentStateChecker.throwAssertion(DeploymentStateChecker.java:88) at weblogic.application.internal.DeploymentStateChecker.illegal(DeploymentStateChecker.java:107) at weblogic.application.internal.DeploymentStateChecker.up(DeploymentStateChecker.java:122) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:166) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90) Truncated. see log file for complete stacktrace

Basically, these errors NEVER truly interrupt anything with deploying a forms based application, unless you want to do more with FADS. FADS deployment looks for some specific libraries and missing them were generating the above errors. As I mentioned, for a classic domain, addressing this error may not be truly necessary (for testing). I just love NO errors under usual scenarios, hence decided to fix it.

I referred the below documents to find a proper solution

The 1st document insists that we must delete/rename the pre-installed SQLDEVELOPER (3.x) under ORACLE_HOME (eg: D:\Weblogic\Middleware\Oracle_Home) & install a version that is minimum 4.2, however doesn’t mentioned anything about the highest version supported.

After checking the fads configuration py file, I realized that the files FADS deployment trying to locate during the startup were NOT available with SQLDEVELOPER 18.x:

‘/sqldeveloper/sqldeveloper/lib/oracle.dbtools-common.jar’
‘/sqldeveloper/sqldeveloper/lib/oracle.sqldeveloper.sqlcl.jar’

The 2nd document I referred explained about configuring FADS & the blogger used SQLDEVELOPER 17.2 for his exercise. Hence I downloaded the specific version 17.2, extracted and copied the folder “sqldeveloper” to ORACLE_HOME & followed the instructions as provided within the Oracle document.

Error while using SQLDEVELOPER 18.x

D:\Weblogic\Middleware\Oracle_Home\oracle_common\common\bin>wlst.cmd D:\Weblogic\Middleware\Oracle_Home\forms\fads\fads_config.py
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor=”Sun Microsystems Inc.”
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands

fads configuration script
Admin Server will be shutdown by running this script.
Do you want to continue? [Y/n] :Y
You need to install Oracle SQL Developer 4.2 or higher under ORACLE_HOME. Did you install SQL Developer 4.2? [Y/n] :Y
error:
SQL Developer 4.2 is not installed under D:\Weblogic\Middleware\Oracle_Home
Install it and run this script again.
Download Oracle Sql Developer from http://www.oracle.com.
exiting…
Problem invoking WLST – Traceback (innermost last):
File “D:\Weblogic\Middleware\Oracle_Home\forms\fads\fads_config.py”, line 341, in ?
File “D:\Weblogic\Middleware\Oracle_Home\forms\fads\fads_config.py”, line 207, in fullConfig
NameError: system

Successful configuration using SQLDEVELOPER 17.x

D:\Weblogic\Middleware\Oracle_Home\oracle_common\common\bin>wlst.cmd D:\Weblogic\Middleware\Oracle_Home\forms\fads\fads_config.py
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor=”Sun Microsystems Inc.”
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands

fads configuration script
Admin Server will be shutdown by running this script.
Do you want to continue? [Y/n] :Y
You need to install Oracle SQL Developer 4.2 or higher under ORACLE_HOME. Did you install SQL Developer 4.2? [Y/n] :Y
SQL Developer 4.2 is installed under D:\Weblogic\Middleware\Oracle_Home
connecting to WebLogic:
Please enter your username :weblogic
Please enter your password :
Please enter your server URL [t3://localhost:7001] :
Connecting to t3://localhost:7001 with userid weblogic …
Successfully connected to Admin Server “AdminServer” that belongs to domain “base_domain”.
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be used instead.
obtaining Admin Server host/port information
Location changed to domainRuntime tree. This is a read-only tree
with DomainMBean as the root MBean.
For more help, use help(‘domainRuntime’)
fadsui.ear:-> D:\Weblogic\Middleware\Oracle_Home\user_projects\applications\base_domain\forms\fads\fads-ui.ear
webservices – http://localhost:7001/fads/apis (updated to http://192.168.125.1:7001/fads/apis)
Saving…
Totals {connections=1, rest=1, updated=1}
updating FADS OWSM policy
creating fads keystore
Already in Domain Runtime Tree
Keystore created
Already in Domain Runtime Tree
Key pair generated
Context is missing, therefore using current context “/WLS/base_domain”.
Successfully configured property “keystore.type”.
Successfully configured property “location”.
Successfully configured property “keystore.sig.csf.key”.
Successfully configured property “keystore.enc.csf.key”.
creating fads WSM policy set
Session started for modification.
Description defaulted to “Global policy attachments for RESTful Resource resources.”
The policy set was created successfully in the session.
Policy reference “oracle/multi_token_rest_service_policy” added.
The configuration override property “propagate.identity.context” having value “true” has been added to the reference to policy with URI “oracle/multi_token_rest_service_policy”.
The policy set restPolicySet is valid.
Creating policy set restPolicySet in repository.
Session committed successfully.
importing fads authorization policy
import fadsWSpolicy passed D:\Weblogic\Middleware\Oracle_Home\forms\fads\policy\fadsWSMPolicy.zip
Importing “META-INF/policies/oracle/binding_authorization_template_fads”
Successfully imported “1” documents
Location changed to edit custom tree. This is a writable tree with No root.
For more help, use help(‘editCustom’)
Starting an edit session …
Started edit session, be sure to save and activate your changes once you are done.
Saving all your changes …
Saved all your changes successfully.
Activating all your changes, this may take a while …
The edit lock associated with this edit session is released once the activation is completed.
Activation completed
shutting down the Admin Server
Shutting down the server AdminServer with force=false while connected to AdminServer …
Disconnected from weblogic server: AdminServer
shutting down the Admin Server
…….done with fads post configuration…………
please start the Admin Server

Exiting WebLogic Scripting Tool.

Once the configurations are successfully completed, the configuration process shuts down the Admin Server. Start the Admin Server & there should not be errors towards missing FADS libraries.

regards,

rajesh

Windows 10 1903 | Oracle VirtualBox virtual machines will not start/open

Hello guys

This is a quick post towards one of the issues I faced once after enabling Windows Sandbox feature that was made available with Windows 10 1903. As Sandbox feature utilizes Hyper-V (regardless whether you have enabled it or not).

Once Sandbox feature enabled, Oracle VirtualBox 6.0.x fails to launch the Virtual Machines.

Although VirtualBox 6.0.x are supposed to support Hyper-V for acceleration, my attempts were futile, forcing me to disable the Sandbox feature, enter BIOS and browse through the virtualization settings.

I can’t say what has resolved the issues. I disabled Sandbox, restarted the box, was unable to launch the Virtual Machines.

Restarted the laptop, entered BIOS and insured that the virtualization was turned on & tried to launch the Virtual Machines and they opened.

So give it a try, if you are stuck with the following error while trying to open a Virtual Machine!

Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED).

regards,

rajesh

Wireless Keyboard/Mouse lags, stutter or hang when USB 3.0 external HDD connected

Hello myself

Recently I replaced my faulty Microsoft Keyboard+Mouse combo with a Logitech K270 & must say, Logitech have some quality.

However, very soon my daughter told me that she cannot use the keyboard & it prints a letter few seconds later after she taps the keyboard. I came to the desk and confirmed that she was right.

I was really upset, I couldn’t believe that a brand like Logitech could make such lousy product which started malfunctioning within couple of hours since the 1st use!

I was copying a huge tar ball from the external USB 3.0 HDD, connected to the port adjacent to wireless receiver was connected. Somehow I managed to close the copying & removed the wireless receiver to check whether it was broken/visibly faulty. Everything looked rock solid. I plugged the receiver back and the keyboard and mouse were working fine once again.

I plugged the USB 3.0 HDD back to the same port near the wireless receiver as I wanted to copy the tar ball. The moment I plugged the external drive, the keyboard and mouse almost stopped functioning!

Yes, after the long story, the solution is, don’t plug the USB 3.0 external drives to the same USB hub where you connect your wireless keyboard+mouse receiver.

That’s a worth note ;) & I hope you are not reading my personal notes!

rajesh

Windows Subsystem for Linux | Backup & restore

Hello guys

WSL 2 is almost here! and if you are here, reading this post. Please consider reading about WSL 2

During one of the recent chit-chats, few of my contacts were asking me about the “real” business sense behind Linux on Windows. It is simple. Microsoft is:

Going to integrate LINUX so deep within Windows that, in the very near future, one don’t have to run a separate LINUX Server. Simple like that.

After experimenting with KALI Linux WSL, I managed to install Xfce & XRDP on Ubuntu 18.04 WSL & the only few things I couldn’t do with the WSL was starting services automatically when the subsystem starts. There are hacks, well, I don’t think they really worth a try soon as Microsoft will BE bringing it on to WSL pretty soon.

Now, let us get back to the topic. I’ve installed Ubuntu 18.04 WSL nothing less than half dozen times. Every time something goes wrong & I am forced to uninstall and re-install the WSL to continue with additional experiments. My last attempt was to install Kubuntu desktop, that screwed my Xfce & after 2 days of continuous efforts to “fix” few “unknown” things, I had to uninstall one Ubuntu WSL that had a fully functional WordPress instance :(

So, I decided to learn how to backup a functional WSL, so that if something goes wrong, I can restore & continue

I’ve ready at few places that Windows 10 version 1903 comes with WSL backup functionality out of the box. Until you decide to upgrade your box to 1903, you may use the below for backing up your dear WSL instance.

I came across a pretty decent thread here & a user Jaime’s answer is the apt ONE, missing only few details like /tmp folder.

Make a tar ball as mentioned by Jaime

# cd /
# sudo tar vzcpf /mnt/c/tmp/ubuntu_`date +%Y%m%d_%H`.tar.gz --exclude=/proc --exclude=/dev --exclude=/mnt --exclude=/media --exclude=/lost+found  --exclude=/tmp --exclude=/sys  --exclude=/run / > /mnt/c/tmp/ubuntu_`date +%Y%m%d_%H`.log 2> /mnt/c/tmp/ubuntu_`date +%Y%m%d_%H`.error

Where /mnt/c is C:\> drive of your Windows Machine. You may change /mnt/c/ to /mnt/d/ or /mnt/e/, based on how your partitions are laid. Closely watch the excluded directories. You MUST exclude them.

My tar ball was around 1.5GB in size & I moved the tar ball to another machine which didn’t have WSL activated.

First you have to enable Window Subsystem for linux from Turn Windows Features on or off (If you are not restoring the backup to same Windows Machine). This will ask you to restart your Windows Machine.

Copy the tar ball to a folder, say, D:\wsl

Download launcher.exe from https://github.com/yuk7/wsldl

Copy launcher.exe to D:\wsl

If you are going to restore a Ubuntu 18.04 WSL rename launcher.exe to Ubuntu1804.exe & rename your tar ball to rootfs.tar.gz

Open an elevated command prompt & switch to D:\wsl

and just execute, for example “Ubuntu1804.exe”

It will take a while for the installation to complete. As the superuser thread states, it installs and opens the WSL for you. From next time, all you need to do is to start Ubuntu1804.exe & your WSL instance is up and running!

However, I had an issue with the restored instance. It was related to missing /tmp folder. I found a solution for it with nixcraft article.

https://www.cyberciti.biz/faq/mysqld-innodb-error-unable-to-create-temporary-file/

Prior trying to start any sevices, those you were using with your backed up instance, make sure you create the /tmp folder like below

$sudo chown root:root /tmp
$sudo chmod 1777 /tmp

Now, try to start your services, start xrdp & enjoy!

regards,

rajesh