Taken from How to mount the Nexus 4 storage SD card on Linux systems and comments there.
Reproduced here so that I can find it again!
Enable Developer Mode
Settings >>‘about phone’ menu and after that you should tap seven times on ‘Build Number’.
Now, from the Developer Options menu enable USB Debugging.
sudo apt-get install mtp-tools mtpfs
sudo gedit /etc/udev/rules.d/51-android.rules
Note not smart quotes as in the article
#LG – Nexus 4 SUBSYSTEM=="usb", ATTR{idVendor}=="1004?, MODE="0666?
sudo chmod +x /etc/udev/rules.d/51-android.rules
sudo service udev restart
sudo mkdir /media/nexus4
sudo chmod 755 /media/nexus4
Next, connect your Google Nexus 4 to your Ubuntu computer using the USB cable. The MTP option has to be enabled.
sudo mtpfs -o allow_other /media/nexus4
To unmount:
sudo umount /media/nexus4