 Hi, I'm Denshi. And a question that a lot of new Linux users ask is how do I virtualize Android on Linux? I'm going to run Android apps on Linux. How do I do that? And my preferred method is using Android X86, because most other methods require you compiling your own kernel. And compiling your own kernel isn't really a new user thing to do. So we're just going to be using a virtual machine with QEMU, which you should install in your system. I'm going to show you how to use that to load up Android and just get a virtual machine spin up so you can use it to run Android apps. If you, for some reason, want to do that. We're going to be using the Android X86 project, as mentioned before, run Android on your PC. Just click the download button, and it'll give you these links to different websites. You can go, there are various variations of this. You can get one that is like Lineage OS with no Google apps. The one I got has the Google stuff in it, which is a little bit irritating for privacy. But if you do need things like the Play Store and Play Services, and you're going to have to use that version. So let's begin by creating an image so we can actually install Android to somewhere. I'm going to do QEMU-IMG, create-f for format, Q, copy on write or COW or Cal, too. I'm going to call it image.img, and I'm going to give it 32 gigs space, just like that. Now I'm going to do a similar thing, but this time we're going to actually load up our system. QEMU-SYSTEM-X86-64, so that's the architecture. We're going to enable a kernel VM, right like that. And we're going to get a CD-ROM, load it up here, CD-ROM. We're in a directory named Android, and there's a file called Android-X86, that's the ROM itself, so I'm going to select that right there, the pressing tab. And then what I'm going to do is set our boot to the disk. I'm going to give ourselves four gigs of memory, that's a little excessive for an Android, but I think it should be okay on x86. And then what I'm going to do is do dash drive, just like to drive, and I'm going to do file, so it's going to be a file, image.img. Now these are all the base options you need to properly install Android, and now let's just load up our system, I guess. Okay, so we're now loaded up into Android-X86, a live installation. I'll zoom this in into the editing software, you should be able to see it sharp and stuff. I'm going to go to the installation section right here, just give it a second to load. Okay, so now I'm going to do shift, C, select the create modify partitions part, going to press enter. I will use GPT, you don't have to, but it's going to be my choice. Just going to press enter. And now what I'm going to do is create a new partition here in this free space, just leave it as it is, just press enter, just press enter, just press enter, leave it like that, it's okay. And now we're going to write, we're going to go over to write, going to type yes. So this creates one partition for Android right there, 32 gigs or Gibi bytes, then one megabyte or 1,000 Gibi bytes of free space right there, which is basically just for GPT to do what it needs to do. I'm going to quit, and now we're back here, as you can see, we see the SDA one partition there, we're going to just select that by pressing enter. We're going to say that we want to format it, we're going to format it to EXT4. So just give it a second to do that. Now we're going to say we do want to install the bootloader grubs, press enter right there, just press yes. So this option doesn't really matter if you do yes or no, just do yes. Now just give it a second to do everything it needs to do to install the operating system. In the meantime, I'll discuss why Android emulation is a little bit tricky on Linux. You see, you can actually emulate a lot of Android programs directly on Linux because Android does use the Linux kernel, but you need to modify aspects of the kernel to make this actually work. So you would have to compile your own. Anyway, as we can see, Android X86 has been installed. I'm not going to reboot. I'm actually just going to close the virtual machine and we're going to just change our command over here. I'm going to get rid of the boot deoption and I'm going to get rid of the CD-ROM. And besides that, we should just be able to press enter and this should load up grub right here. So as you can see, we have grub, I'm going to press enter and soon Android should begin loading up, hopefully. Okay, as you can see, Android is loading up. It's got a little loading animation. The resolution is odd. There are some things you can do to edit that, but that's beyond the scope of this tutorial. I'm just going to take a look at how to virtualize things. And if you will be virtualizing Android, you should probably just be running it like this, like a window of this size and higher resolutions can be a little bit odd with it. Okay, so we're finally in it. And I think you notice a very big issue here. The colors are inverted, but fear not, we can change that just a little bit of an error with XORG. You might not get this color inversion error on what you're using, but it might happen. And if it does, I'll show you how to change this. I'm just going to start over here. If you want to connect to the internet, click to see all networks and you'll see VIRT Wi-Fi. So connect to this. This is pre-installed on the Android X86 and it lets you connect automatically to the internet through the virtual machine. So it can just click on VIRT Wi-Fi as you saw there. Okay, so it's all the date and time stuff. I don't really have to say this is already set automatically so we can leave it as it is. Oh, here's all the Google stuff. As you can see, the Google logo itself is inverted, which is quite funny. I'm going to turn these all off and you should do that as well regardless of whether you're using Android X86 or whatever, you should always turn these things off or even better, flash your own custom ROM. Protector tablet, I'm going to say not now. I don't want to protect it because nobody's going to steal my virtual machine. Okay, here I'll ask you to select a home map. Choose task bar for a more kind of like desktop-esque experience because what it does is well, it adds this little task bar and you can have this little menu over here to close it and open it. It's got an application menu with a search, kind of like Windows. And it's got this thing over here where you can see all the currently running widgets which aren't really here at the moment. So what I'm going to do is I'm going to show you how to fix this color issue, which is pretty ridiculous. Gmail has become blue. So I'm going to go to settings. Okay, so we're going to want to go to accessibility, which is down here in the settings. And we're going to go down to the section that says color inversion. So just hold down this and there you go. We've now fixed the color issue. The colors are now accurate and correct. That's pretty much all you really need to do to install this. You can get a terminal emulator and this is a rooted Android. Like you can do everything that you could do with a rooted Android device because if you open the terminal and try to switch the root user, so SU will see that it asks for root permission. So I'm just going to grant it this time only. And as you can see now I have root permissions and move over to the root directory. I'm going to list it and that's my root directory. So yeah, this is pretty much a full fledged Android experience for the desktop. You should probably optimize this more by modifying resolution and things. I'm not going to show that in this video because it can get quite long if you do all the optimizations and things. But for basic Android apps you would want to run like I don't know a bank program or something that's exclusively on Android. You can't get it on Linux or your regular phone or you don't want to install it to your phone. Or you just want to test out Android apps just for fun or if you're a developer you want to test them out to make sure they work on x86. Then this is for you. I've been Denshi. This has been virtualized Android. Goodbye.