Offical TWRP has been released for this device.
https://twrp.me/motorola/motorolamotox4.html
It seems to have a couple active maintainers.
TWRP builds linked from here are no longer active, but the bootable may remain important to use.
---
PLEASE ENSURE YOU ARE USING THE PROPER METHOD FOR YOUR FIRMWARE! (There are Nougat and Oreo sections here now)
WARNING: Several users have run into trouble trying to do factory reset from in the Android menus after root. (THIS IS TRUE ON MANY DEVICES!!). Just don't do it...use TWRP instead.
Obviously, with any tinkering you're risking your device and you need to know how to get yourself out of trouble if you find yourself in it. Make backups, have stock firmware (especially stock boot.img) on hand.
Rooting WILL break your ability to receive OTA updates. Period. Please don't ask me to figure out how to flash an OTA once you are rooted, because my answer will be to flash stock firmware, take the OTA and then re-root.

OREO ROOT METHOD #1:
1. Download Magisk 15.3 patched boot image: https://drive.google.com/file/d/1uM5...w?usp=drivesdk
2. From bootloader, flash patched boot image with fastboot flash boot <name of file>
3. Reboot and check if Magisk Manager is installed (sometimes it fails...). If not, download and install latest Magisk Manager and check that Magisk is properly installed and running.
OREO ROOT METHOD #2:
0. Ensure you are starting from stock boot. I HIGHLY recommend flashing factory 8.0 and starting fresh.
1. Download SuperSU 2.82 SR5: https://forum.xda-developers.com/app...v2-05-t2868133
2. Download fastboot BOOTABLE TWRP image: https://drive.google.com/open?id=12C...CZQNKEqkprBO0u
3. Copy SuperSU to SD card
4. From bootloader type: fastboot boot twrp-x4-BOOTABLE.img (don't flash this...BOOT it.)
5. From TWRP flash SuperSU ZIP
6. Reboot and check if SuperSU app is installed. If not, download/install it, update binaries, boot back to TWRP and flash SuperSU again.
**NOTE: Root works WITHOUT the SuperSU app or any other root manager! This is obviously dangerous from a security perspective so make sure the app is present and running. (i.e. that you are prompted to grant/deny root).
NOUGAT PREFERRED METHOD:
As of 1-2-2018, the "beta4" version of TWRP on this thread (https://forum.xda-developers.com/mot...sting-t3707432) is working on UNENCRYPTED devices. The Motorola X4 stock firmware is specifically designed to encrypt your device on the first boot even if you have formatted and removed encryption. So, the process invovles flashing TWRP, formatting data, patching the system to prevent re-encryption, and flashing SuperSU. If you want TWRP recovery with root, are willing to format and lose all data, and are willing to leave your data UNENCRYPTED (!), please use the link above to travel to the TWRP thread -- otherwise, stick with the original method below.
NOUGAT 7.1.1 ORIGINAL METHOD:
All credit for this belongs to @Chainfire for his amazing tools at http://firmware.mobi. I simply used his tool to create this image and test it. This means, if you prefer, you can go to that site and download the CF Auto Root package for this device. Just realize that the image you are downloading was uploaded by me... so it isn't gonna turn out any different.
Step 1: UNLOCK your bootloader
Step 2: download boot.img from below
Step 3: connect your device via USB
Step 4: Open ROOT terminal and verify connection with "adb devices"
Step 5: Reboot to bootloader with: adb reboot bootloader
Step 6: Wait for bootloader to boot, then type the following command to boot the image (we are booting from the patched image, not flashing it!)
fastboot boot boot.img
DOWNLOAD: https://mega.nz/#!UtMAAawQ!T-QCLdAQ1...-DihZVdJMXdpzg
MD5: 57e7e2f446a43d9bf9b1f22865eb412c
Credit: Chainfire, http://firmware.mobi, Magisk: https://forum.xda-developers.com/app...mless-t3473445
---