Using Dragon with Linux

When I first started using Dragon, I was bummed to be restricted to Windows. Fortunately, there are lots of ways to work around this limitation and use it with whatever operating system you want. I’ll cover the method I use and describe some alternatives.

My home set up is simplest, because I cheat and just use Cygwin to provide a UNIX-like environment. This lets me launch GUI Emacs to write code and edit my macro files (which have to live on Windows). I highly recommend starting with this approach, since it gives you many of the niceties of a Linux environment, but you also benefit from the estimable built-in support Dragon/Dragonfly has for Windows, such as contexts, task switching, and window management. For task switching in particular, though, I don’t use the built-in Dragon commands. Instead, since I almost always run the same set of apps, I pin each of these to the taskbar and bind labels to “Windows key + number” shortcuts to quickly jump to any app. This gives me full control over the naming of the apps, and is generally less error-prone than using the built-in “switch to” command.

My work setup is necessarily more complicated, because the software I develop has to build and run on a special company-specific installation of Ubuntu. To do Linux development, I rely on NX, a remote desktop solution. The huge advantage of NX is that it supports “rootless” mode, which makes the remote Ubuntu windows look like native Windows applications, each with a named pinnable taskbar button. This works great with Dragonfly contexts and my task switching solution described earlier. This solution also works well if you want to install a Linux distro on Windows via virtualization. I’ve done this before with VirtualBox with good results. VirtualBox provides its own rootless mode, but when I tried it about a year ago it didn’t work nearly as well as using NX on my local machine. The trick to setting this up is to configure port forwarding within VirtualBox for the NX port, and then connect to localhost within Windows.

If you are installing NX yourself, the process is a bit complicated due to recent changes that have limited the free feature set in version 4 (the latest version). I recommend using an open source NX server, such as FreeNX, and version 3 of the official NX Client for Windows. You can also try open source NX clients, but make sure to choose one that supports rootless mode.

The final component of my setup is to use Putty for SSH port tunneling. As I will describe in another post, I run an HTTP server within Dragonfly, so that I can send contextual information to Dragon from other apps, such as Emacs. Thanks to reverse port tunneling, I can expose this HTTP server running on Windows to my Linux machine in a completely secure way. I also use standard port forwarding when I want to expose servers running on my Linux machine as if they were running on my Windows machine. There are plenty of guides available online that explain how to set this up.

The solution I’ve described is to use Windows as your host, and Linux as your guest. There are ways to swap those if you wish, although I think it is a bit of an uphill battle because Dragon is so closely integrated with Windows. One solution that is gaining popularity is Aenea. I haven’t tried it myself, but if you think I’m missing out, please let me know in the comments!

20 thoughts on “Using Dragon with Linux”

  1. “The huge advantage of NX is that it supports “rootless” mode, which makes the remote Ubuntu windows look like native Windows applications, each with a named pinnable taskbar button.”

    Uh, the built-in Cygwin X server also supports this…

    1. That’s good to know. I haven’t tried that, but my understanding is that NX performance is much better than X. I work remotely with a range of applications, some of which are graphically heavy. This probably makes a lot of sense though if we’re talking about connecting to a virtual machine on the same physical box.

      1. Normal X servers are fine for machines on the same LAN. There is quite noticeable latency for high latency links — my work VPN is around 140 ms and it makes Emacs/xterm startup take several seconds (Emacs has something like 3000 X requests to startup). Still usable, but low-grade frustrating. Sounds like I should try NX again.

  2. Note that many X servers have bugs where virtual keystrokes are concerned. I have personally gotten the Cygwin X server bugs fixed as well as the Reflection server ones if I remember correctly. I haven’t tried NX as I remember it being a real pain the ass to install.

    1. Installation isn’t too bad, the hardest part was just finding the right pieces since the latest version doesn’t work. Fortunately, for my Ubuntu VirtualBox installation, the FreeNX server installation Just Worked. The client installation was also easy, the hard part was just finding the client installer since it’s an old version.

  3. FYI, it’s quite easy to have your voice command source code live on your remote/VM Linux box and use Rsync via voice command to copy it to the local PC for use. This is what I do with my Vocola commands.

  4. Hi, I am budding, self taught developer, with a background in motion graphics where I developed a case of mouse RSI. Your recommendation of Vimium has drastically helped my quality of life, thank you so much. DNS is the next step.

    I have been reading the mastering emacs book you recommended along with a book on Git and Linux in my free time. I want the fundamentals down and mastered to feel confident moving forward. I am currently using Sublime and it leaves a lot to be desired.

    Here is my current pickle, I am looking for a good resource to install emacs on cygwin. I have a vague idea that I need cygwin to run an x server which then serves emacs in a window. I’ve noticed there are a lot of emacs packages to install when I run cygwin’s setupx86.exe. Internet searches on the topic feel dated or written with haste.

    Your blog is inspiring, really glad I found it.

    1. Hi Drew, I’m really happy to hear my blog has helped you so far!

      Simply get the emacs-w32 package and let the installer download all the dependencies. When you then reopen Cygwin and run “emacs”, a nice graphical version of Emacs will open up in a new window.

      The only thing to watch out for is that Cygwin doesn’t play well with some applications that may be installed on your computer. For me the “GeForce Experience” app is the problem. You can find more examples if you Google “BLODA”. The symptoms will be that Emacs behaves erratically, and in the Cygwin window you will see errors about being unable to fork processes. With any luck none of this will happen to you 🙂

      1. I’m laughing at myself for how simple that was.

        The other day I mentioned to my buddy who develop’s chrome dev tools, that I was learning emacs and he relied, “I don’t know you to be the religious type” 😉 I told him about my plans for DNS and he was interested. He said he has been resting his hands every other day now.

        In 2014 you mentioned in a comment that you could probably write a whole post about the benefits of using emacs vs other IDEs as well as your emacs configuration. I’m taking your hints on Mastering Emacs and Prelude, however I personally would enjoy a really dry post about Emacs if you ever get inspired to do so.

        Thanks so much for your help, really excited to dive into emacs this weekend.

  5. Great stuff, Vimium actually solves the problem of how to automate chrome! Because I can macro keyboard shortcuts easily enough.

    1. I actually created my own chrome extension to improve on existing ones for navigating chrome by voice. Check out click-by-voice.

  6. You mentioned that “VirtualBox provides its own rootless mode, but when I tried it about a year ago it didn’t work nearly as well as using NX on my local machine. ” Can you explain what exactly didn’t work as well with VirtualBox as it did with NX? Thanks!

    1. Just retested this, albeit with an old Ubuntu installation. There were a few obvious issues just from a couple minutes of use:
      1) The windows were not separately named on the taskbar, so the usual technique of using window name as context for commands would not work.
      2) The experience was all-around janky. For example, portions of the desktop were visible as part of the different windows.

      Perhaps this has improved with recent versions of Ubuntu (note however that I was using the latest VirtualBox). Let us know if you find a good way to get this working. The NX workaround is not great.

      1. I’m currently using a Ubuntu host, with Windows 7 as a guest. (currently Ubuntu 18 but before, using Ubuntu 16 with no real difference). I’m only doing voice programming using SSH over putty, and vim as text editor, so I’m not doing a lot of interaction with windows etc. The only commands that interact with Ubuntu hit are for typing into vim and the terminal. It works pretty well, but could be better.

        On the one hand, doing basically everything on the guest (Windows) is less than ideal, and not just for performance reasons. On the other hand, last time I switched computers from my old one to my current one, and I didn’t have to re-setup my windows VM at all, just installed virtualbox on the new machine and moved the VM file over and it worked, which was nice.

        However, I’m thinking of getting a new computer soon, and switching over to using Windows as the host, so just wanted to see what others’ experiences were.

  7. Do you have any recommendations for this setup regarding computer specs (HD, memory, processor, etc)?

    Knowbrainer, DNS and others have their own recommendations, but due to the additional factor of running a VM all the time, I’m wondering if you had any thoughts on what additional requirement that brings.

    Thanks again

    1. The main consequence of running a VM is (considerably) higher memory usage. I would recommend 16 GB minimum or preferably 32. And as you’ve probably heard elsewhere, I would recommend a CPU with fast cores and a large cache. I would also recommend an SSD generally, although I don’t know that it makes much of a difference for speech recognition.

  8. Another solution to consider is WSL2, and somewhat orthogonally VS Code (with the remote extension). WSL2 seems to work pretty well, and you can use VS Code either to access WSL2 on the same machine, or to open folders on remote Unix machines over ssh.

Leave a Reply

Your email address will not be published. Required fields are marked *

Markdown is supported. Make sure raw < and > are wrapped in code blocks. You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.