top of page

UE4 and Linux

Why oh why did I try out linux?

Maybe I'll make a linux game, "IT Professional Simulator"? Maybe I'll become a blender super user? Maybe I'll learn to script in python and be the envy of everyone at work (no wait, they already know python). You can do all those things on Windows anyway, so really I must have just been bored this weekend. Sometimes you gotta take that spontaneous, irrational holiday into the murky neighbourhoods haunted by database engineers and system administrators (viz., hackers).

You too can become a glossy new linux user. Just search on Youtube and watch some of those 5 Things To Avoid When Starting With Linux, and 5 Tips Every New Linux User Should Know, and 5 Reasons to Switch to Linux Now! At least get some idea of what lies ahead first. Bear in mind using Linux alongside Windows is better than switching over cold (if you already have Windows running). Disclaimer : I did try Ubuntu years ago, so I already knew typing commands into a Terminal is the path to the dark side.

Anyway, if you are tempted to try linux for the first time, here are some things to be wary of:

First step. Buy a USB, a brand new flash disk, or better yet, find one that's been in a box of pencils for a decade. (Here comes a rant...)

Shown actual size (mostly it is the connection, the universal part). Paying for a socket, basically.

I haven't bought storage for a long time, like Years. I've never had much luck with external drives. If they don't get wiped by my own body heat or minutely damaged so the connector no longer registers in the machine unless I rotate it at 13.33 degrees and hold it there with a coke lid. They're fossil technology, but in this case they're needed to put a Linux distribution's installer on it and make your BIOS use it as a boot option. The shop across the street seems to only offer 8GB as the minimum now. The OS installer need only a fraction of that, but I figured I can always scrub it later and use it for, maybe, I dunno, there isn't really much use for USB drives these cloud-based days. I got one that was smaller than my thumbnail. I will probably lose it before I've even claimed the GST.

Make sure you buy a USB type that your PC has a connection for. For example, in one PC I have a TypeC, but on another I don't, so to use this installer on both I had to settle for USB 3.1. Many cheap computers still only have USB 3.0, so make sure you don't waste money on a little tab of solder you can't use. Fortunately, I knew this subtle detail, because I often watch Linus Tech Tips in an insomniac daze at 3:30am (https://youtu.be/gShRBsahzXg). If nothing else, I paid a coffee's worth of Saturday income to take a quick walk across the street to the appliance store. They always seem to sell them either naked (potentially already broken therefore) or in thick plastic or carbonite packaging you have to cut open with a serious knife. For which, since we're here: https://gun.deals/catalog/brands/316 seems to fit the bill. If your relationship with linux doesn't work out and you just want to end it all, it may come in handy.

Besides getting a USB, deciding which version of linux to try is important. It's like trying out the style of sunglasses they have at the gas station. They're all about the same at face level, and there's a bunch of 'em. Some people make their choice based on solid criteria, like Puppy Linux is really small, so it can run entirely in memory, making it run snappily, but it looks a little dated. Other distributions, like Kali, are aimed at network security penetration (if that's the type of penetration you like). Elementary is designed to resemble a Mac desktop layout, Zorin OS is designed to resemble Windows desktop layout.

To get started, I downloaded Elementary OS 4.0 Juno 64bit (https://elementary.io/). I liked the clean looking GUI. I didn't know anything else about it. I didn't even know it was supposed to look like Mac OS before it was already running. Shrugs. Downloading was by far the easiest part.

I used a utility called Rufus to make the .iso file to go on the USB. (https://rufus.ie/). Figuring out this part made me feel like a super user already.

I tried installing first on a computer that doesn't include much that matters (my work computer). The target drive only had Windows and installed programs. No risks. What could go wrong?

The linux installer did prompt me to install linux alongside windows, but its offer was to split the hard disk about 50-50, which I didn't want, so I tried the option to manage partitions, which was a nightmare. I have two identical brand SSDs so telling them apart in a partition table isn't easy. It was also difficult to tell at what point you could or could not back out of specified changes. My inner UX expert was freaking out, but I bravely guessed my way through (about five or six times). I made mistakes, I struggled to fix them. I started over, determined to get UE4 running on linux before the end of the evening .... before the end of the weekend.

Beginner?

Saturday : What went wrong?

From browsing other user issues, it seems that linux (at least Elementary OS) likes to install to the first available SSD and my new partition was on the second SSD, basically an A and B choice for the installer and it seemed to default to putting Grub (a core part of the OS installation) on disk A, which continually failed to be found (though it's right there, in plain sight, after all).

For a new user, this is fine, right?

I tried a lot of things, but basically failed and ended up wiping a drive to clear the partitions I'd made and reinstalling Windows ... this itself also was a pain because my carefully safeguarded authentic Microsoft Windows USB stick was old (I lost several previous ones thus learning a hard lesson: Microsoft is greedy). The upshot is that there's been hours and hours of updates to gradually download and gradually install to refresh to the latest main release, and then I had to reinstall software. Luckily nowadays I copy all my application settings online. Save-game storage in the cloud has taught us something, right?

Sunday : What went right?

The partition and drive choice problem showed me what to expect doing the install on my main PC, where I decided to use the alongside windows option, accept the partition size it offered, and of course, the A and B drive order was already using the first SSD so I didn't have any problem with the Grub failing to figure itself out. But this was just an inch of progress overall.

After installing linux (Elementary), I had to move my PC to the room in the house entirely dedicated to the modem, which sits there at night blinking rudely like a weird digital gremlin (it's in a room of its own like it thinks it's a mainframe or a server or a missile launch control system), just so that I could plug in a LAN cable because the wifi driver doesn't come with the distribution. What confidence in an OS does that give new users? A key behind a locked door. So... If you cannot run your PC using a LAN connection (like you're on a laptop and don't have a cable-based ethernet connection) don't try installing linux. Well, maybe consider trying Arch, because apparently that does (though don't count on it being easy : http://www.linuxandubuntu.com/home/how-to-setup-a-wifi-in-arch-linux-using-terminal). While unconnected, you won't get options to include updates during install, and you won't be able to connect to anything to add required updates (like the wifi driver) after installing. Of course, if you just want to type notes to yourself, that is okay. [To be fair, maybe there are friendly distributions of linux where the installer supports wifi off the bat, but my little thumb-drive did not, at least not that I could tell.]

So.. proceeding to plug in. I didn't want to, but I plugged in. An old 2m blue LAN cable with a wonky connector that's hard to pull out because the release catch busted. But after circa 10 years, it still worked passably. After plugging in, and running Update All from the AppCenter (a utility in Elementary), the operating system started to download some bulk updates, like an iPad that hasn't been turned on for a month. Tired of watching progress bars, I went for a walk with Eden and Toffee to Paremuka lakeside (shown below, thanks Google Street View).

Eden and Toffee

When we got back, the PC had turned itself off (because of power management defaults), but it was apparently enough time for the hundreds of Operating System updates to finish. And wifi worked out of the box (apart from the need for all the previous part), and I'd already jotted down the password and such the night before and just had to enter it... You have entered the matrix.

If I may offer a tip!

I kept my iPad on hand with google search primed so I could try out linux commands from others who had inadvertently solved my troubles (questions asked by frustrated innocents in that short twilight time between getting linux and giving up and going to bed, answered by lonesome power users whose knowing and caring would remain on stackexchange and reddit as an example for future generations). Truth be told, it's comforting to have a working browser available, which would be there just in case I wiped my drive or booted to a blue or black infinity with no cursor or input. That's the true purpose of a mobile device, isn't it, apart from selecting Youtube channels to ignore day after day? Armed with other people's knowledge, I felt better about trying out a Terminal to enter commands. Reading up on hints and solutions to find your way through any problems seems to pay off. I should find a reference book (a free online one; http://linuxcommand.org/tlcl.php)

What went wrong?

Installing NVidia's latest driver wasn't as easy as it could be. If you go straight to 'linux Nvidia driver' on google and get Nvidia's linux driver .run file for the latest version, you have to be able to figure out what to do with a .run file. A raw install of Elementary seems to not be set up for that. I couldn't get it to work anyhow, although now .run files seem to be fairly easy to handle. I'm assuming I managed to update the OS to include the required bits and bobs (or most likely I just missed the right steps from not knowing at all what the options were).

To get the graphics driver updated, instead of bothering with the raw .run file, I added a package repository. What's that? Well, it's kind of website that will feed linux the packages you need (or it needs) if you add the site as a package source. For Nvidia, I added : sudo add-apt-repository ppa:graphics-drivers/ppa

More than any other steps people suggested (not to me but to other bereaved linux hopefuls), this single line was like a magic rune. If you're actually trying to figure out installing Nvidia drivers, best read : https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/

Even the ability to add repositories may need some initial commands and updates. Many solutions I found online required further initial expected groundwork to have already been done. Since I was starting dry, I probably spent four times longer than necessary reading about other people's versions of the problem, before finding the steps that actually pertained to my query. Because it's like reality TV, isn't it? Fascinating, raw, primordial gouts of panic and confusion cast into the ocean of the internet like messages in a bottle.

In the end, I managed to install the latest Nvidia driver, and the mysterious X Network utility, and switch from Nouveau (whatever that is) to using the Nvidia driver. But I was still stuck in a low resolution, and the X Network utility would only open blank, like literally a UI widget with no content. Restarting didn't help. A lot of users reported their LightDM(sic because i dunno wtf that is) booted them to a black screen, which scared me, so I didn't try fixes involving rebooting.

There's this command called xrandr -q which will tell you your monitor's resolutions, but commands based on xrandr might fail with this warning: xrandr: Failed to get size of gamma for output default. This makes you feel like you need to find that perfect magic rune to set your resolution. But the reason really, is that your monitor's cable type hasn't been correctly defined (probably defaulting to VGA instead of the more commonly used HDMI, DVI or DisplayPort). VGA is to monitors as USB drives are to file storage.

I tracked my way through a lot of complaining forum posters, and one guy was talking about VGA and my monitor uses DisplayPort. You might not be using a DisplayPort monitor, but you ought to, because high resolution, high refresh rate monitors are great, and you'll need your system to pass data to them through a decent cable. Accordingly, I started reading about making linux register DisplayPort and found my way to downloading a DisplayPort USB package, without any real hope it would work. Nothing appeared to change. My monitor still insisted it was unknown in Displays. Well, it is a Kogan monitor; but I wasn't quite ready to assume it was just impossible to get it to kick in because it was a budget Australian brand nobody has heard of. It works fine in Windows. I actually quite like it. So, I restarted the machine and magically the DisplayPort driver kicked in, and the monitor behaved and the NVidia settings took over and thar she blows... 3440x1440 at 100hz, almost for no work. No xrandr, no grep, or chmod or bash, not even a purge.

Before worrying about monitor resolution, check your monitor connection type is registered.

Well, assuming you can find your own monitor's required drivers or cable driver or whatever, I basically stumbled upon what I needed, which was this: DisplayPort USB package : https://www.displaylink.com/downloads/ubuntu Accept their User Agreement. Download, Extract (or use Archive Manager to do that for you). It's almost best to do this in an experimental haze when you don't know either way if you are getting the right files or totally the wrong files. It's a gamble.

Note - as with the Nvidia driver this DisplayPort driver turned out to be one of those .run files. They seem fairly commonplace, so you'll have to figure out how to use them eventually (I said to myself through tears). In Elementary, in the Files utilty, you can RMB on your .run file and choose Run. If that's not available, there must be a package you have to find to run .run files.

The goal is to make it executable. So far as I can see this is just a matter of setting the file properties so your User can execute it.

What went right?

Once Nvidia and DisplayPort drivers were obtained, nothing else really posed a problem in terms of the system working as expected. So I jumped over to Unreal Engine and read their QuickStart to installing UE4 on linux. Amazingly, their steps are clear and short, and I already had my account setup and github repository stuff sorted out from Windows, so all I had to do was download the Release, extract that, 'make' or build it, and run it. This took a while in terms of just unpacking files, but there weren't any nightmare exceptions or hoops to jump through or critical failures, which is rare in these troubled times we live in.

Note - For UE4, I chose the Release version rather than the cutting edge version just for safety. If you have a lot of plugins managed through the Windows Unreal Launcher, and you open a project depending on those plugins, your manually built version in linux might not like the project. I'm sure it's possible to add plugins manually, but it might take some patience to rebuild the engine to use them, which isn't something I'm bothered to do. Starting a vanilla project is just fine.

Install UE4 in Linux

Base folders for a linux UE4 project. Not much to show for the weekend, but folders isn't nothing.

Small side note - possibly a bug?

Elementary OS in linux uses a Mac style dock for its application icons. This can be set to hidden when not in use. Running UE4 seems to put this out of reach until you alt-tab out of the editor or minimize, and also the outer edges of the unreal editor don't seem to be adjustable, though I might just not have figured out how as yet. The icon changes to move arrow, but it doesn't allow resizing.

Oh, another tip!

Install a password manager and a screenshot utility. You may have to jump around logging into various web services in order to just find help, and get all those new device email authenticate steps done. Since I've been using windows all this time, I have LastPass and wanted to use it on linux, because why start over entering all the passwords you're basically trying not to have to enter in the first place? The instructions on the Lastpass web-page for installing in linux are wrong. Or, almost right... you decompress their installer and it tells you to go into a folder (cd lplinux) that doesn't exist yet to install a package which isn't there, which Terminal can't do. So you add the folder yourself and run the command again, but the files are in the previous directory, so Terminal fails again. So you intuit that you could move the files you unpacked into the folder you created yourself. Then, like sun breaking through clouds, the Terminal command provided by LastPass works just fine and you're happy (slightly stressed out, but happy).

Yet another tip!

Consider getting a System Resources monitor that lets you set the priority of tasks when using UE4. This will let you set unimportant processes to Low and set the Shader Compilation processes in UE4 to high, for example. This is more or less the equivalent of using Prio in the Task Manager in windows. To do this there are probably a lot of options, but the GNOME Project offers GNOME System Monitor you can find in AppCenter by searching 'process priority'. I don't know if it saves user changes like Prio does in Windows, or if there is a similar program for linux that does so.

Final tip!

I'm a long time user of Greenshot for capturing screen images. Sadly this tool doesn't have a linux version, but I tried out Shutter that I found by browsing various Greenshot alternatives, and it seems reasonable. I use screenshots to post on forums when I get stuck and need help, which is regrettably more frequent than using screenshots to brag of something cool that I did on my computer. To install UE4 in linux I didn't need to post any forum pleas, but I did spend a lot of time making pictures for this long-winded blog post, so that worked out well. But your results may vary.

Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page