 Last week I made a video where I did a base installation of Gen2 Linux inside a virtual machine and people asked me, hey, could you continue on with the installation? Could you show us how to install Xorg and a window manager or a desktop environment? And that's a great idea. So what I'm going to do today is I'm going to take that same virtual machine and we're just going to continue on. I'm going to install the X11 display server and I'm going to install a window manager. So the first thing we need is we need to pull up some documentation. So the Gen2 wiki has a great guide here for installing Xorg. It's called Xorg slash guide and I'll follow along with this a little bit. And of course you guys need to follow along with it as well. Now I'm going to be installing Xorg and I think I'm going to install DWM for a window manager just because DWM doesn't have very many dependencies at all. It shouldn't take very long at all to compile DWM. Now a full desktop environment like GNOME or KDE Plasma, the compilation times can take a while. Also, you got to make sure your use flags are correct because you're going to have to add more use flags than what I'm doing in my make.conf because DWM really doesn't require much. The first thing we need to do is edit the Etsy portage make.conf file because we need this to use X. So we need to add the X use flag. So let me fire up this VM. We had the root user of course and I created a home user, a DT user, but he doesn't have root privileges yet because we haven't installed sudo or anything like that. So we need to be root for now. So I'm going to log in as root. I'm going to give it my strong and complicated password. And now that we're logged in as root, what I want to do is I want to open nvm slash Etsy slash portage slash make.conf because we need to correct some stuff here because this is not correct. As a matter of fact, this really caused me some problems on the video a week ago because I edited the wrong make.conf file. That video last week, the compilation times were taking extremely long because I edited the make.conf file on the live ISO in the live environment. I did not edit the make.conf file that we were actually mounted to at slash mnt slash gen 2 slash Etsy slash portage slash make.conf. So that's why, you know, the compilation times were taking forever in that video the other day is because I thought I'd given the virtual machine six threads of my 24 thread thread ripper. But honestly, I had only given it one thread because I edited the wrong file. So you can go back to the gen 2 installation handbook and look up some of this, but I'm just going to give some just basic default stuff. So common flags here, what I'm going to do is dash march equals native space dash o2 dash pipe. That's fine for that. And then we don't have a make ops line and we need that. That's telling make.conf here how many threads of my CPU to use. So I'm going to do make ops equals and then inside double quotes. I'm going to do dash lowercase j and then the number of threads. It needs to be the number of CPUs you gave the virtual machine in this case plus one. I think I gave the VM six threads. So I'm going to do dash j seven. And then the other thing that tripped us up in the video the other day is when I tried to install certain software, certain licenses of software. It wouldn't let me install because I never went through the trouble of setting this variable here. Accept underscore license equals. And then what I need to set that to is a asterisk because that's accepting every license available, whether it's the GPL, whether it's free and open source licenses in general, whether that's a binary redistributable or even Microsoft ULU licenses. I want to accept everything. The next thing we need to do is the use flags. So we know we're going to need the X flag, right? Because X or you're not going to be able to compile some of these programs, the graphical programs without having X as a use flag. I'm also going to specifically till the use flags not to compile for GNOME. So I'm going to do a minus GNOME minus KDE because we're not going to use those particular desktop environments. So I don't want to waste time compiling programs that could possibly use the GNOME or KDE use flags because we're just going to be using a tiling window manager. In my case, I'm going to install DWM. Now, looking back at the documentation, some of the other stuff that we need to add to the make.com include input underscore devices, video underscore cards. Now, how do you actually know what input devices and video cards you need? Obviously, the video cards are going to be your driver. So that would be like Nuvo if you wanted the open source NVIDIA driver or NVIDIA. Of course, if you wanted the proprietary or Radeon for AMD, Intel for Intel. Now, what I'm going to do is I'm actually just going to escape and then do colon WQ to write and quit out of VIM. I'm going to run this command at the command line, portage Q, all one word. I guess portage query is maybe what's going on. And then space ENVVAR, so environment variable, and then input underscore devices, all caps. And it should tell me what my input devices currently are set to, what that variable is set to. I'm using lib input and lib input is fine. You may also want to add synaptics according to the documentation here. See the example is input underscore devices, lib input and synaptics. That's for touch pad support. And I just think for sake of completeness, let's actually add that to our make.conf. So let me get back into the make.conf here. I'm going to create a new line and I'm going to set input underscore devices equals. And then let's do lib input space and then synaptics and then closing quotes there. And then we need to set video cards, video underscore cards. I could do portage Q ENVVAR, video underscore cards and get what those are currently set to on my system. But I'm going to set this specifically to use my particular driver because I'm in a virtual machine. The virtual machine graphics driver I'm using is the vert IO driver. Now those of you that are using Intel, you'll want to put Intel here or Nuvo or Radeon or AMD GPU or whatever. It is the video driver you use for your system. That's what needs to go there. You can specify more than one, actually, if you need to. Of course, you need to make sure that the actual driver you plan on using is part of the list. That's the main thing. Now, one thing that the documentation mentions is, you know, when we play around with this make.conf and add some use flags to it, you may need to go back and recompile your kernel if you did a custom kernel. If you guys remember how to do that, you need to CD into user source Linux CD into that and run the make space menu config command. Wait a second and then you get your incurses program here where you can go through and tick on some stuff or tick off some stuff and then recompile the kernel. Now I didn't do a custom kernel. I did a gen kernel. So I don't have to do this for those of you that do have to do this. It looks like what you need to do is go down to device drivers. And for device drivers, you want to find input devices wherever that is. Let me go down input device support. I believe is what you need. And then somewhere in here is event interface. Now that needs to be enabled. It's already enabled. So I don't have to do anything. So that's fine for me. If it's for some reason not ticked on for you, make sure that is ticked on. The next thing you need to do is go back into device drivers and find graphics support. And here is graphics support. Hit enter on that. And for graphics support, what you want to make sure is disable anything that needs to be disabled. For example, if Nuvo happened to be ticked on, but I was an NVIDIA card user and I wanted to use the proprietary drivers having this ticked on would be a problem. So disable Nuvo if you wanted to use the proprietary NVIDIA driver. Now this is not a problem for me. So I'm just going to exit back out. The other thing you'd want to do is you'd want to go into device drivers, graphics support. And then there's a frame buffer setting somewhere in here, frame buffer devices. Now in this, you may have a setting for EFI based support. You want to enable that. If you did a EFI installation, I did a MBR installation. So I don't have to worry about that. But then, of course, you would want to save this. And then, of course, recompile your kernel. I installed the gen kernel. But again, I was just doing this just to show you guys that do need to recompile your kernel. Some of the settings you may need to go in and play with. So now at this point, before I continue, I really think I want to get sudo installed. That way I can switch over to a non-root user to do some things. Because eventually, once we get Xorg started, you know, I don't want to start X with the root user. And that's typically not what you want to do. It's actually a non-root user that actually starts Xorg and launches into your window manager or desktop environment, right? You don't want to log in as root. I've already got a user on the system called DT. But let's go ahead and emerge space apt-admin slash sudo. I look that up on the Gen2 site. So that is the package for sudo apt-admin slash sudo. And now that we have the make.conf actually using more than one thread, hopefully. Hopefully this stuff will not take that long to compile today. And sudo finished installing rather quickly. Now we need to edit the sudoers file to give all of the members of the wheel group sudo privileges. So as root, what I'm going to do is I'm going to edit the slash etsy slash sudoers file. And then I'm going to do a search for the word wheel. And I'm going to go to this line right here and I'm going to uncomment this here. It's warning me that I'm changing a read-only file. That's fine. And what this is going to do that line says that every member of the wheel group has all privileges. Meaning they can do anything as long as they invoke sudo. So let me write and quit. Give it the exclamation point because that was a read-only file. And just to verify that this worked, I'm going to su to the DT user. So switch user to DT. And then now as DT, I'm going to do a sudo vim. I'm just going to open up vim with sudo privileges just to see if that actually works. It's asking for a sudo password. So and now that is working. So we have a working sudo for the DT user. Now, because almost everything I do today, I'm going to need root privileges for. I will go ahead and issue back to the root user. So this is just so I don't have to type a password. Now the next thing we need to do is actually install Xorg. So as root, I'm going to do an emerge space dash AV because I do want to some verbose output here. And then I'm going to do X11 dash base slash Xorg dash server. And then we also want to install the X11 dash base slash Xorg dash drivers. I'm going to go ahead and run that. It's calculating the dependencies. And it has a problem with our use flags. So we're going to have to edit the make.comp file one more time. It says we need E log in D or system D as the use flag. And it says exactly one of E log in D or system D. So let me go ahead and vim slash etsy slash portage slash make.comp. And in the use flags here, I'm going to go ahead and add E log in D. So E log in D. Then I'm going to write and quit that and up arrow. And I'm going to run that emerge command one more time to install Xorg server and Xorg drivers. And assuming it's okay with our use flags now. Yeah. Now that's going to take a long time to install Xorg is a rather large bundle of packages is I want to say it's nearly 100 packages. And it's obviously going to have to compile it here on Gen2. So I'm going to step away for a little while while this runs. All right. And Xorg dash server is finished emerging and Xorg dash drivers as well. Now let's go back to the documentation because it says after emerging Xorg dash server, you really should run a ENV dash update and you should resource your slash etsy slash profile. So let's go ahead and do that. So I'm already root. You need to have root privileges to run this command. So ENV dash update and we get a little bit of output letting us know that that was successful. And then I'm going to source the slash etsy slash profile and no output is good output on that. And going back to the documentation, we're at the point now where now that we've got Xorg and the drivers installed, we could run start X but there's nothing to actually start because we don't have any window managers. Also, what you really want to do is make sure that X term is installed before you try to start X because if something happens where for some reason it can't launch you into your window manager or desktop environment, what start X should do is launch you into an X session that is filled with three X terms, three X term terminal emulators. But of course to do that, you need X term installed. So let's go ahead and install that. I'm going to emerge, I'll give it the dash AV flags one more time here and I'm going to do X 11 dash terms slash X term. And that should install X term for us. I don't know how long X term takes to compile. And now that I have X term installed as root, I'm going to go ahead and type start X. And let's just see if we actually, yeah, so the X server is working. You see this is the default kind of X session that just launches three instances of X term. What you need to do to get out of this is find the root window, the very first one, which is going to be the one on the far left. Type the word exit, which kills X term, which of course gets you back into the command line. Now let's go ahead and install our window manager. I'm going to go ahead and emerge dash AV and I'm going to do DWM, which is X 11 dash WM slash DWM. And DWM does have some other things that you need to install along with it. You probably should install the ST terminal. It expects ST to be installed. It also expects D menu to be installed. So let me go to the wiki and look up the package names for those. And it looks like ST is going to be X 11 dash terms again, similar to X term, except slash ST. And then the D menu is going to be X 11 dash MISC miscellaneous slash D menu. And these shouldn't take very long to emerge at all because these are very, very small programs with hardly any dependencies. And now that we've got DWM installed along with ST and D menu as root, what I'm going to do now is I'm going to try to start X space DWM. And let's see if we can actually launch DWM. No, we can't. All right. So let me see what the problem here is. Let me get back into the documentation. One thing it mentions is earlier we added the E login D use flag and E login D needs to be added to open RC. So let's run this command here RC dash update space add space E login D space boot because we want E login D to start every time we reboot the machine. Right. All right. Now that we've done that, what I'm going to do is I'm going to reboot. It's a good idea to reboot anyway. We've done a lot here without rebooting. All right. We've got the login prompt. I'm going to go ahead and log in as root. So let me enter my super secure password. And now let me start X space DWM and see if it will actually let us launch DWM. It will not. One thing the documentation, the wiki for Gentoo mentions is that you may have to run a dispatch dash comp command. I guess if you've played around with any config files, you need to run as root or with pseudo privileges. If you're a non root user dispatch dash comp. And now it's asking do we want to queue for quit H for help in for next E for edit new Z for zap new U for use new M for merge T for toggle merge L for look merge. I'm not really sure what to choose here. Obviously we need to choose something other than quit or help. So I'm not sure how about you for use new. I have no idea if that actually did anything. But now I'm going to start X DWM. One of the things is saying X term bad command line option DWM. Maybe I'm just not typing a good command. Maybe if I just did start X and then how about the full path to the binary user been DWM. There we go. So I don't know if I really needed to do the dispatch dash comp. But I guess it didn't hurt anything. But there we are logged into DWM as root. Now I believe super enter would give us a S term or is it alt enter alt shift enter. Alt shift enter gives us not a X term the simple terminal ST. Alt P would give us a D menu prompt. And to get out of this, I believe all shift Q. Yeah, gets us back to the command line. Now of course we don't want to log into a window manager or a desktop environment as root. So let me switch over to my DT user here. And let's see if the DT user actually can start X and user slash bin slash DWM. And he cannot, which I was expecting that because what we really need to do for the home user in my case, the DT user is we need to edit a X and yet RC file and make sure that that file executes DWM. So I'm going to CD. So I get into my home directory because we were in the root directory because we did a SU switch user from root and we were in the root directory. So let me CD into the home directory for my user and do a LS space dash LA and see if there is a X and yet RC file here in my home directory. There is not. So let's create one. So I'm going to do VIM space dash X and yet RC. And this is going to be a shell script. So I'm going to do crunch bang slash bin slash SH and then I'm going to hit enter a couple of times. And the only command I want it to run is execute DWM. And then I'm going to hit escape. I'm going to do colon WQ and VIM to write and quit. And now I'm going to do a start X as the DT user. And we still get an error here. Let me do a sudo reboot just to see if a reboot would help here. And we're back to the login prompt. I'm going to log in as DT. And I'm going to try a start X one more time and start X without the capital X. And now, yeah, it just needed a reboot. So after we created the X and yet RC file, reboot the machine and then type start X as your home user. And of course you log in to DWM and just make sure that everything works. There's ST and there's D menu and there's really nothing else installed on the system. This is still a very bare bones installation. So let me escape out of D menu there and Alt Shift Q to quit. So there you guys go. That was just a very quick and dirty video. I really didn't even follow the XOR guide. I'm really bad at following documentation sometimes. Sometimes I just go at my own pace or my own way because I feel like, hey, I'll probably run into some errors, but I'll figure it out. I'm one of those kinds of people. But you guys should follow closely the Gen2 XOR guide. But it wasn't hard at all, right? That wasn't very hard at all to set up a few use flags and then compile XOR server and XOR drivers and then install a window manager and then edit X and it RC file. And then when you log in, type the command start X and you log automatically into your window manager for those of you that wanted to install like a login manager like light DM, you know, you could do that and then you don't even have to fool with start X. Those of you installing full desktop environments like Genome or KDE Plasma, of course, you're not going to have to fool with the X and yet RC and start X because Genome and Plasma, they come with their own login managers. So those will be squared away. The only downside to installing the full desktop environments is they install a whole bunch of packages and you're going to have to compile for a really long time and you're probably going to have to play with a lot more use flags than what I did. You know, DWM really makes things simple because it's such a minimal window manager. Now, before I go, I need to thank a few special people. I need to thank the producers of this episode. FC Gabe James Mitchell, Paul Wes, Akami Allen, Chuck Kurt, David Dillon, Gregory Irion, Alexander, Peace Arch and Fedora, Polytech, Raver, Scott, Steven, Willie, these guys. They're my highest tiered patrons over on Patreon without these guys. This quick installation of Xorg and DWM on Gen2, it wouldn't have been possible. The show is also brought to you by each and every one of these ladies and gentlemen as well. All these names you're seeing on the screen right now. These are all my supporters over on Patreon because I don't have any corporate sponsors. It's just me and you guys, the community. If you like my work and want to support it, please consider subscribing to DistroTube over on Patreon. All right, guys. Peace.