Tag Archives: linux

dolphin-emu compile error: ambiguating new declaration of u64 _xgetbv(u32)

If you follow the official instructions for compiling Dolphin game emulation on your own, you are likely to encounter this error at the ‘make’ stage in the step 3:

dolphin/Source/Core/Common/x64CPUDetect.cpp:41:12: error: ambiguating new declaration of 'u64 _xgetbv(u32)'
static u64 _xgetbv(u32 index)

Googling this error, you will see some solutions from as far back as 2018. You don’t need to bother with these.

This error happens because you were actually reading the instructions (as opposed to skimming through them), and did ‘git checkout tags/5.0’ to get the “stable” version. Sadly, the 5.0 version is super outdated – it was last updated in 2016.

So, you were misled by an outdated wiki page that nobody bothered to fix. Here’s how to compile Dolphin nevertheless.

# Assuming you've already created and entered the 'Build' directory, do this:
cd ..; rm -rf Build
# Then, switch to the main branch, where up-to-date development actually happens
git checkout master
git submodule update --init # just in case! might not be needed

Then, start again from the step 3 – ‘mkdir’, ‘cmake’ and all. The build should succeed.

This compiles the latest development version. It might have bugs – however, it seems to me that Dolphin has given up on releasing ‘stable’ versions. My understanding is, this is as good as you’ll get.

Nobody with access to Dolphin Wiki bothered to fix this old and quite outdated instruction. I hope that happens soon. In the meantime, this post shall serve as a guidance for anyone encountering this exact error.

If someone with editing access to Dolphin Wiki is reading this – remove the ‘checkout tags/5.0’ thing, the 5.0 tag is broken and won’t compile for anyone not running a system out of 2016.

mullvad (or other wireguard) and tailscale coexistence – tailscale not pinging

my linux to linux tailscale connection would not ping, except that ‘tailscale ping’ itself worked. i rememnbered I also had mullwad. looking a bit, I found this wonderful post with explanations on how it all actually works. the guy rebooted to have it work tho, and I didn’t want to reboot.

I did the systemctl fix he suggested (despite the “before” and “after” confusion in his conclusion and “fix” sectiion, weird), but restarting units a few times in different orders (including the tailscaled unit) didn’t help and the rules stayed the same as in his “broken” example, tailscale rule after mullwad rule in ‘ip rule’ order.

do read the post for insights, but still, in short, this helped:

sudo ip rule add preference 5207 from all lookup 52
sudo ip rule delete preference 5270

looks like this can be put in a script, too, and the rules stay consistent between installations? idk. likeeee, check ‘ip rule’ output and script things at your own risk.

importing vm from virtualbox to qemu, and a small virt-aa-helper fight

I used ubuntu 20.04 or something

First, I used this tutorial to convert the vdi image to qcow2. I then installed qemu and libvirt and co on my new vm host system, moved the files there and used some long command I no longer remember to create a new virtual machine using some libvirt thing? I had to activate “default” network for that command to work, IIRC.

virt-viewer helped me connect to the vm’s screen, and it showed “booting from hard disk” and got stuck there, turned out I had to add an UEFI image because that’s what VirtualBox also used or smth. I used “virsh edit” for that IIRC, opening an xml file that was unexpectedly easy to read and modify, and this snippet in the <os> section helped:

<loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE.fd</loader>

We did it, Reddit. This is all you need.
It’s tempting, but wrong, to add this too:

<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>

You absolutely should not add the <nvram> section, only the <loader> one. Seems like qemu will try to write into the <nvram>-located file, and if you give it the OVMF_VARS.fd file, virt-aa-helper will throw apparmor-looking errors. saying “error: skipped restricted file” and even “internal error: cannot load AppArmor profile”.

It might look like apparmor is shouting at you, but if you look at syslog and kernel.log messages carefully, it’s actually virt-aa-helper, an additional layer of defense and protection way before apparmor even gets a chance to react. Adding or editing apparmor profiles will do nothing!

Changing the virt-aa-helper’s behaviour requires recompiling libvirt, but you don’t have to – just don’t add any nvram store and let qemu/libvirt/whoever add its own store, it will appear on its own in the xml file next time you launch the machine, I think.

from there… don’t touch it, I guess? or touch it, I’m not a cop. Anyway, that’s how my 1h+ detour into apparmor finished, with “just remove the nvram section with the /usr/share default file”. Makes sense that each guest gets its own nvram that’s assigned automatically, tbf.

Making luakit play YouTube videos

Luakit, even though it’s a quite awesome (and fast!) browser, doesn’t play YouTube videos out-of-the-box. At least, when installing it from Raspberry Pi Debian repos, it doesn’t pull the dependencies need and doesn’t even list the packages as ‘recommended’. Nowhere I could find it, but one Arch Linux forum page had a hint, which I decrypted:
Install gstreamer1.0-libavย and gstreamer1.0-alsa – the latter being responsible for sound in YouTube videos.
That’s it. Hope it helps =) If you find it’s still not working for you – comment below, I’ll try to debug the issue.

Debian Jessie, VirtualBox – driver compilation failing because kernel sources cannot be found

I installed the Debian Jessie (testing) system from an around 3-month-old CD. Then I installed virtualbox and while installing it has complained that kernel sources are not found. I’ve installed linux-headers package and all the linux-headers packages that I could have found, but still no luck. I kept getting the following message:


The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

‘/etc/init.d/vboxdrv setup’

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.


/etc/init.d/vboxdrv didn’t even exist! As I knew VirtualBox used DKMS, I did aptitude reinstall virtualbox-dkms, and it still outputted “Module build for the currently running kernel was skipped since theย kernel source for this kernel does not seem to be installed.”ย I even installed linux-source – it didn’t help. So what was it?

My distribution had an older kernel, as it was on the CD I installed everything from. Since then, things changed – 3.13 was replaced by 3.14. The repository only had linux headers for 3.14 – and when I installed linux-headers metapackage, I installed headers for 3.14, even though system used the 3.13 kernel. So – when a vboxdrv can’t be build, check if you really have headers for the kernel version you are using =)

Now I just need to learn how to read properly. And to reboot my PC =)

Where and how should Linux begginers start

I have constantly been working with Linux for over 2 years from now. I remember how I started, messing up my system from the very first try to get to know Linux (my PC OS was indeed a little bit fragile back then), and how I continued from there, experimenting, messing things up and restoring them to their previous states – and gaining experience in huge portions through all the way forward. Now I’m the one who’s capable of teaching people about how things work and how to work with things.

I’ve decided to write a short guide from my experience for those who are trying not only to use, but also to understand what lies behind a nice-looking desktop of Linux PC and what all those words people type in console to solve problems are about. So, if you’d like to understand how a Linux system works and thus are ready to dive into a world of Linux – I’ve prepared some tips for a good start.
1) Get yourself a dedicated Linux machine.

One of the options to choose from…

…and here’s another one worth considering.

Seriously, buying yourself an old PC/laptop/RPi/something else has never been so easy. Why not using a virtual machine? Well, VM is OK – unless you’re trying to experiment, which is what I’m talking about now. Of course, both VM and separate PC are similar – you can mess everything up but nothing happens to your main PC, so they free you of fear of experimenting ๐Ÿ˜‰ But VM doesn’t somehow motivate you, at least, that’s what my experience is.
Why? It hasn’t got any real use. All the Linux PCs have one or multiple. And VM relies on the host PC – that means the same downtime. Downtime ain’t that good for your Linux server – not because it’s a word many system administrators in bigger companies are afraid of ๐Ÿ˜‰ It’s just because your server has less time for performing some tasks. Thus, it’s much harder to give your server a real use.
Why should yours have one?

2) Make it do something useful.
Useful things are the outcome of your practice and experimenting that you really see. Your best indicator of how your training goes. If you have set up your Linux PC as a router, it will work for you. If you make your VM a router, you’ll turn it off to conserve energy and plug in your Linksys router instead. That’s not exactly useful. Make this machine do something in your home that doesn’t yet exist or make it replace something that already works. Making yourself rely on this machine is good – you’ll be trying to improve it to make it suit your needs. What tasks could one possibly have with a dedicated Linux machine?

  • Home router (gateway)
  • File server (All your files still belong to you, but you can access them from everywhere)
  • Backup machine (never losing your files again! Or, at least, having more or less recent copy =) )
  • Torrent server (breaking the law with so much ease)
  • Audio streaming server (your favourite radio station playing your own music…)
  • Audio streaming client (…or your favourite internet radio station always playing at home)
  • Audio playing client (imagine speakers connected to one machine and this machine receiving sound from all other PCs)
  • Web-server (platform for your practice in developing web-sites, or, maybe, even for your own public blog or 9Gag clone)
  • Info station (like laptop always turned on and showing weather conditions on its screen)
  • Alarm clock (your wakeup is no longer defined by those default 10 alarm tunes in your mobile phone)

Could be this, or….
[Madskillz] Home automation centre (imagine turning on the teapot while you’re 5 miles away from home!)
[Logan’s Loophole] Robotic barista mixing drinks as you wish to
[Control freak] Surveillance camera control centre
[IMPOSSIBRU] Device automatically hacking every network available out there (no link, sorry)
[Super Intelligent] Your own Artificial Intelligence Unit, just one Debian package away! [Lie]

Ok, you got the point. You could also combine things, like torrent&file server, hacking
neighbours’ networks in free time – how is that to you? But one thing is definite – it should do something. You’ll be pleased by your results, you’ll get more experience and those cool real-life features that no VM could provide will make you want more of those features.

Being in a never-ending circle of getting experience – does it get any more cooler?

3) Be prepared for the mistakes

Things break. Happens to everybody, sometimes it’s the user’s fault, sometimes it’s all about developers’ typos –ย  but still, you will make mistakes, and if you’re new to Linux –
mistakes will be unavoidable, Linux needs some additional knowledge. Either way, you’ll be sometimes forced to fix things. Sometimes it will be much better to just start everything again, waiting for an hour as OS is being reinstalled…
BTW – great power of Linux is that even in case of major problems it hardly needed to reinstall OS itself, but the thing is you’ll need to do this if you experiment as you’ll learn to mess things up much earlier than you’ll learn to do them right, and sometimes learning to repair and repairing is much harder than to recognise just why this happened and learn to never do this again, so you need to decide if that all debugging and fixing is worth it. Not to mention that trying to fix a problem for hours
makes you frustrated – if you have the possibility to somehow roll back, either by restoring a backup or simply reinstalling, you’ll save your nerve cells.

As a conclusion for this – don’t throw out your
installation CDs ๐Ÿ˜‰

4) Make backups as long as you do something good

Well, under this picture there’s one more story hidden.

Backups are not necessarily large files containing full snapshots of your system. Sometimes it’s OK just to save link to instructions that helped you set up Linux gateway. Sometimes it’s good to backup your command-line history as this will remind you which commands you’ve used to do this or that. Sometimes you’d want to backup your /etc/ directory somewhere else – it’s your server and you have some configs there that you worked on for hours, combining options to ensure the solution is perfect. Why’d you want to lose them? And, provided that you experiment, you might lose them, so ensure you don’t.

Simple cp command in cron to always attached flash drive should be enough.

5) Don’t be afraid of command line

Picture not necessarily related

See, Linux is kind of based on command line and heavily depends on it, unlike Windows, where you can hardly do anything from it. So if you want to learn Linux, you need to learn all those commands. As we all know, practice is the best kind of learning – so remember that GUI shouldn’t always be your assistant in doing things. In Linux, GUI utilities that help you do stuff can’t do anything that can’t be done from the CLI – keep that in mind when you, for example, configure “pulseaudio” and need to download many, many GUI tools that’d help you do that.

It doesn’t necessarily mean that you need to use only CLI in the beginning – it’s hard to just switch. Yet commands aren’t that hard to learn. It’s possible that after some time you’ll be willing to learn some new awesome commands that your system is able to process. Also, feeling when you don’t need to move your hands from the keyboard to the mouse is awesome, at least for me ๐Ÿ˜‰
Not even mentioning your increased typing speed after mastering command-line tools.

I guess that’s all by now. The next article you’ll probably find useful will be telling about Linux distribution that I am using – Debian. I’d like to tell you about the most important things – why I chose Debian, why I’m still using it, and why I think you should at least try it, as well as give some basic overview of Debian as a system. And, should you have questions about this article – just ask!