DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Join us tomorrow at 1 PM EST: "3-Step Approach to Comprehensive Runtime Application Security"
Save your seat
  1. DZone
  2. Data Engineering
  3. Databases
  4. Make Windows Green Again (Part 4)

Make Windows Green Again (Part 4)

The quest to bring Linux to Windows continues. Let's tackle an error caused by mismatched tech, namely getting the distro to run on something other than VMware.

Hannes Kuhnemund user avatar by
Hannes Kuhnemund
·
Feb. 24, 17 · Tutorial
Like (1)
Save
Tweet
Share
3.71K Views

Join the DZone community and get the full member experience.

Join For Free

While we discovered in part three of this blog series how to run graphical openSUSE Linux programs within WSL, a lot of readers, including myself, started exploring this new opportunity. Given the feedback we received (either through comments or direct emails/chats), it seems that many of us (and by that, I have to count myself in) hit a road block at some point. Things didn’t work out as expected.

I have one piece of good news, and two pieces bad news for you. The good news is, it’s not really openSUSE related, however, the first bit of bad news is that it’s not only affecting graphical programs but command line tools as well, and the second piece of bad news is that it’s because of WSL itself not providing a 100% compatible environment that Linux is expecting. So any Linux within WSL, including the default one, that we replaced, is going to face very similar issues. But SUSE to the rescue!

Lscpu

Lcspu is a neat command line tool that gathers information like CPU architecture, number of CPUs, threads, cores from sysfs, and /proc/cpuinfo, among other sources (you might compare it to a section of Windows’ Control Panel -> System). It is part of the util-linux package. Running the default version of lscpu within openSUSE Linux shows surprisingly … nothing (while it actually shows something on the default Linux, which we replaced). Here’s the output on my x230 laptop:

OpenSUSE:

hkuehnemund@X230:~$ lscpu
hkuehnemund@X230:~$
hkuehnemund@X230:~$ rpm -q util-linux
util-linux-2.28-7.1.x86_64


Default Linux:

hkuehnemund@X230:~$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) pro Kern:    2
Kern(e) pro Socket:    2
Socket(s):             1
Anbieterkennung:       GenuineIntel
Prozessorfamilie:      6
Modell:                58
Stepping:              9
CPU MHz:               2901.000
BogoMIPS:              5802.00
Virtualisierung:       VT-x
hkuehnemund@X230:~$
hkuehnemund@X230:~$ dpkg -l util-linux
[...]
ii  util-linux                  2.20.1-5.1ubuntu20 amd64
hkuehnemund@X230:~$


So a newer version of util-linux (2.28) isn’t showing anything, whereas an older one (2.20) works? Isn’t that strange? Well, sort of – but not really. The following explanation has been provided by my colleague Stanislav Brabec, our SUSE maintainer for util-linux.

In util-linux > 2.20, a new function has been implemented: vmware_bdoor() (or WMWARE_BDOOR()), which is an assembler code inside is_vmware_platform(). It is expected to crash on all systems except VMware. That is why lscpu installs SIGSEGV handler segv_handler() and sets sigaction(SIGSEGV,) to catch this crash.

On a standard Linux, SIGSEGV is caught and the code continues. WSL is halfway toward implementing this. Rt_sigaction(SIGSEGV,) succeeds, but the signal handler is not installed. That causes the application to fail:

rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigaction(SIGSEGV, {0x403a40, [], SA_RESTORER|SA_SIGINFO, 0x7f8ffde54950}, {SIG_DFL, [], SA_RESTORER, 0x7fcf159e4950}, 8) = 0
+++ exited with 1 +++


And now?

Well, two things where SUSE contributed:

  1. We reported the issue to Microsoft – and it is going to be fixed with Windows 10 Insider build [15002+].

  2. For everyone not running Windows 10 Insider build [15002+] (like me), Stanislav proposed a fix upstream, and a soon to be released update to openSUSE Leap is going to ship a new version of util-linux that has the fix included. Just make sure to run ‘sudo zypper up’ now and then to trigger the update.

To keep this article a quick 5-minute read, let’s move the topic of issues with graphical tools to the upcoming blog, part 5.

Table of contents:

  • Part 1: Install openSUSE Leap 42.2 in WSL
  • Part 2: Ensure proper user setup
  • Part 3: Enable Graphics
  • Part 4: This article
  • Part 5: Coming soon
Linux (operating system) OpenSUSE News Control Panel (Windows) code style IT Database Crash (computing) LEAP (programming language) Blog

Published at DZone with permission of Hannes Kuhnemund, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Using JSON Web Encryption (JWE)
  • Project Hygiene
  • Public Cloud-to-Cloud Repatriation Trend
  • Spring Boot Docker Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: