Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. QProcess execute linux commands on WebAssembly
Forum Updated to NodeBB v4.3 + New Features

QProcess execute linux commands on WebAssembly

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
6 Posts 4 Posters 1.2k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nsourl
    wrote on last edited by
    #1

    Hi,

    Does anyone know if it is possible to call the QProcess function with a Linux command (e.g. "ls -al /root") in a Qt WebAssembly application?

    I tried to run a simple application with a QProcess call, it compiles normally for WebAssembly but the web app it seems to cause Firefox slow performance issues and it's probably hunged.

    Thanks!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I don't know if QProcess is supported on WASM at all.

      But an even bigger problem is looming here: WebAssembly runs in web browser sandbox. It does not have access to the filesystem (that would be a massive security risk!), nor does it allow you to run system commands.

      I'm not sure what you are trying to do, but it's either a totally wrong approach or something completely impossible.

      (Z(:^

      N 1 Reply Last reply
      2
      • sierdzioS sierdzio

        I don't know if QProcess is supported on WASM at all.

        But an even bigger problem is looming here: WebAssembly runs in web browser sandbox. It does not have access to the filesystem (that would be a massive security risk!), nor does it allow you to run system commands.

        I'm not sure what you are trying to do, but it's either a totally wrong approach or something completely impossible.

        N Offline
        N Offline
        nsourl
        wrote on last edited by
        #3

        Hi @sierdzio ,

        I am currently working on the development of a Qt desktop application but we were discussing the ability to extend, using Qt WebAssembly, the application usage in a web browser too.

        So, I am currently investigating based on our development so far whether it's feasible or not since I had no prior experience with Qt WebAssembly. Until now, the main roadblocks seem to be Linux system commands execution and local persistent storage (SQLite). That's why I was wondering if I am doing something wrong with my approach to call QProcess from web app or even if it's completely impossible.

        Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?

        Thanks.

        KroMignonK 1 Reply Last reply
        0
        • N nsourl

          Hi @sierdzio ,

          I am currently working on the development of a Qt desktop application but we were discussing the ability to extend, using Qt WebAssembly, the application usage in a web browser too.

          So, I am currently investigating based on our development so far whether it's feasible or not since I had no prior experience with Qt WebAssembly. Until now, the main roadblocks seem to be Linux system commands execution and local persistent storage (SQLite). That's why I was wondering if I am doing something wrong with my approach to call QProcess from web app or even if it's completely impossible.

          Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?

          Thanks.

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #4

          @nsourl said in QProcess execute linux commands on WebAssembly:

          Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?

          This is not a Qt WebAssembly limitation, it is a WebAssembly at limitation/security issue.
          As @sierdzio already told before, WebAssembly is sanboxed ==> https://webassembly.github.io/spec/core/intro/introduction.html#security-considerations

          You cannot have access to local processes / file system.

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          N 1 Reply Last reply
          2
          • KroMignonK KroMignon

            @nsourl said in QProcess execute linux commands on WebAssembly:

            Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?

            This is not a Qt WebAssembly limitation, it is a WebAssembly at limitation/security issue.
            As @sierdzio already told before, WebAssembly is sanboxed ==> https://webassembly.github.io/spec/core/intro/introduction.html#security-considerations

            You cannot have access to local processes / file system.

            N Offline
            N Offline
            nsourl
            wrote on last edited by nsourl
            #5

            Hi @KroMignon ,

            Thank you for your reply, now it's clear to me that it depends on WebAssembly limitation.

            Let's assume that the Qt WebAssembly app will be running on a Linux device, do you think it could be a suitable approach to create another Qt app(service) that will communicate via websockets or REST API with Qt WebAssembly app and be able to run Linux commands and access local file system?

            Thanks.

            1 Reply Last reply
            0
            • lorn.potterL Offline
              lorn.potterL Offline
              lorn.potter
              wrote on last edited by
              #6

              You can use websockify or similar proxy server to communicate with webassembly (which is client only).

              Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
              Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved