# SOLVED ~ Compiled and installed MC, Xorg, Fluxbox, Xfe &  Leafpad, error on startx



## Otho (Jan 22, 2022)

This is my 1st experience with FreeBSD, I've been using Linux Mint for the last few years so have some experience with terminal, but I'm not overly technical. I followed trihexagonal's instalation tutorial (trihexagonal org/tutorial html). And got as far as typing startx before encountering a terminal error.
From the searching I've done it appears it is a problem with video drivers.

System                HP EliteBook 840 G1 Notebook PC
CPU                     Intel Core i5-4300U CPU
Graphics              Intel HD Graphics 4400

Error received     Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices

I've attached a photo of the screen with the error messages. The laptop has a BIOS and I included VESA drivers as well as all the Intel graphic drivers I seen when I installed. 
As I am not proficient with FeddBSD, if you need more information please be explicit as to how I should obtain it. The same with instituting any solution. I used ports for this install, I'm not above starting over with packages but would prefer not to, this is a learning exercise more than anything.


----------



## drr (Jan 22, 2022)

Otho said:


> The laptop has a BIOS and I included VESA drivers as well as all the Intel graphic drivers I seen when I installed.


Hi Otho, have you loaded the i915kms driver through /etc/rc.conf?


----------



## eternal_noob (Jan 22, 2022)

Otho said:


> I've attached a photo of the screen with the error messages.


No.


----------



## monwarez (Jan 22, 2022)

A quick search of the model name give this information:

discrete graphics card: AMD Radeon HD 8750M, with 1GB dedicated DDR5 video memory

It appears that this is a dual graphics system, if it is the case you will need to tell Xorg to use the integrated one(assuming that this is the one that is connected to the screen).

If you could give us /var/log/Xorg.0.log it will be better


----------



## Friend Of Jolly Devil (Jan 22, 2022)

Can you post 'kldstat' command output? If I remember correctly, you need to install graphics/drm-kmod and xf86-video-intel. Do you have it?


----------



## Otho (Jan 22, 2022)

let's try the picture again


----------



## Otho (Jan 22, 2022)

monwarez said:


> A quick search of the model name give this information:
> 
> discrete graphics card: AMD Radeon HD 8750M, with 1GB dedicated DDR5 video memory
> 
> ...


I hadn't seen the info about the desecrate video I'm assuming the integrated one is the one that controls the screen. How would be the best way to do these things? I tried to open the log file with nano (not installed) and vi which I have no experiance with and ended up stuck in a screen of tildes and no idea what how to get out.


----------



## Otho (Jan 22, 2022)

drr said:


> Hi Otho, have you loaded the i915kms driver through /etc/rc.conf?


I don't believe so. unless it was listed as an Intel graphics driver in the setup, then I probably did, how can I check this?


----------



## grahamperrin@ (Jan 23, 2022)

Otho welcome to FreeBSD Forums.

Which version of FreeBSD, exactly?

`freebsd-version -kru ; uname -aKU`


----------



## Otho (Jan 23, 2022)

grahamperrin said:


> Otho welcome to FreeBSD Forums.
> 
> Which version of FreeBSD, exactly?
> 
> ...


FreeBSD-13.0-RELEASE-amd64-disc1.iso


----------



## Otho (Jan 23, 2022)

grahamperrin said:


> Otho welcome to FreeBSD Forums.
> 
> Which version of FreeBSD, exactly?
> 
> ...


13.0-RELEASE-p6
at the end of everything it says
amd64 1300139 1300139


----------



## Otho (Jan 23, 2022)

Friend Of Jolly Devil said:


> Can you post 'kldstat' command output? If I remember correctly, you need to install graphics/drm-kmod and xf86-video-intel. Do you have it?


I don't know how would I find out and if I don't how do I get them and install them?


----------



## grahamperrin@ (Jan 23, 2022)

Thank you.



Otho said:


> … `vi` which I have no experience with and ended up stuck in a screen of tildes and no idea what how to get out.



People get stuck in vi(1) too often. Sorry. As a joke, I made a desktop background of a hint that's integral to FreeBSD:

<https://forums.freebsd.org/posts/519987>



> If you accidentally end up inside vi, you can quit it by pressing Escape, colon (:), q (q), bang (!) and pressing return.



It's helpful, but still, laughable (LOL).

Future installations of FreeBSD might allow newcomers to choose something more user-friendly from the outset.


To people who want to argue about ee, nano or vi: please *don't* waste the space here. Instead:









						What is your favorite text editor?
					

I would like to know which text editor you use in FreeBSD, I like vim very much to program, for very simple things I usually use nano.  Which one is your favorite?  PD: This does not try to be a flame "emacs vs vim" just a nice debate.




					forums.freebsd.org


----------



## grahamperrin@ (Jan 23, 2022)

I have experience with 850 G2 but not 840 G1.



Otho said:


> … Graphics Intel HD Graphics 4400 …





Friend Of Jolly Devil said:


> … If I remember correctly, you need to install graphics/drm-kmod and xf86-video-intel.



Not quite. If I recall correctly (I'm not at my usual computer): not in combination with each other.

<https://www.freshports.org/x11-drivers/xf86-video-intel/#description> expresses support, but not as a requirement.

From the mention of Intel _i5-4200U (Intel® HD Graphics 4400)_ at <https://github.com/freebsd/drm-kmod/issues/44#issue-771462643> I assume that with FreeBSD 13.0, drm-kmod should suffice.



Friend Of Jolly Devil said:


> `kldstat`



Yes, output from this command will be useful but first, Otho please run the command below as root, then restart FreeBSD.

`sysrc -f /etc/rc.conf kld_list+=i915kms`

sysrc(8)



Otho said:


> let's try the picture again



I'm sorry that your computer, or FreeBSD, is a _tortoise_ :-)

Do BIOS settings – probably function key 10 (F10) on your HP – include anything to disallow use of the discrete graphics card?

(You might ultimately use the AMD graphics hardware, if present, but for now it might be better to focus on driving the Intel hardware.)


----------



## Friend Of Jolly Devil (Jan 23, 2022)

grahamperrin said:


> Not quite. If I recall correctly (I'm not at my usual computer): not in combination with each other.
> 
> <https://www.freshports.org/x11-drivers/xf86-video-intel/#description> expresses support, but not as a requirement.
> 
> From the mention of Intel _i5-4200U (Intel® HD Graphics 4400)_ at <https://github.com/freebsd/drm-kmod/issues/44#issue-771462643> I assume that with FreeBSD 13.0, drm-kmod should suffice.



The situation with Intel drivers is a bit complicated. I had to install both of these. Yes, drm-kmod *should* suffice, but if not, install the other driver too.



grahamperrin said:


> Yes, output from this command will be useful but first, Otho please run the command below as root, then restart FreeBSD.
> 
> `sysrc -f /etc/rc.conf kld_list+=i915kms`



But first run 'kldload i915kms' as root and see if you will be able to run X then. If yes, run the above command.

Try to read this first. Trihexagonal's tutorial misses some crucial steps.


----------



## monwarez (Jan 23, 2022)

You can use termbin to post your xorg log
`cat /var/log/Xorg.0.log | nc termbin.com 9999`
Also try to do `startx` with a non root account, some GUI application will not work if run by root.
Do not forget to add the regular user to the video group

Also the output of
`pciconf -lv | grep -B3 display`


----------



## grahamperrin@ (Jan 23, 2022)

Friend Of Jolly Devil said:


> … The situation with Intel drivers is a bit complicated. I had to install both of these. Yes, drm-kmod *should* suffice, but if not, install the other driver too. …



Interesting (thanks for that), I hesitate before referring to this, but here goes:

<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259410#c3>

Reading between the lines there, I _assume_ a third `xf86-video-⋯` item: `xf86-video-intel` *and* "… These are used if you don't have any graphics driver installed …". Good assumption, or poor conflation? I don't know, sorry, whilst I'm without my usual system.

Also I hesitate because for a long time, maybe years: I, too, had the port of an XFree86 driver installed alongside a KMS driver; loading something other than the `i915kms` module; and for a while, specifically *not* naming the module to load it.

Otho if you're drowning in jargon, sorry!

Friend Of Jolly Devil there's much more to my case, feel free to open a topic about your case then we can compare notes. Thanks.


----------



## Friend Of Jolly Devil (Jan 23, 2022)

To check if you have both installed run 
`pkg info xf86-video-intel drm-kmod`

If it says 'no package matching' install it using ports. After installation run as root 'kldload i915kms' and check if you can startx.


----------



## Otho (Jan 24, 2022)

grahamperrin said:


> Yes, output from this command will be useful but first, Otho please run the command below as root, then restart FreeBSD.
> 
> `sysrc -f /etc/rc.conf kld_list+=i915kms`
> 
> ...


Ran the command rebooted twice hope it wasn't a one off thing, no change.
As the Mock Turtle said "We called him Tortoise because he taught us." (it's a learning experience)
I poked in to every nook and cranny of my BIOS and see no place to select graphics cards or chip sets.


----------



## Otho (Jan 24, 2022)

Friend Of Jolly Devil said:


> But first run 'kldload i915kms' as root and see if you will be able to run X then. If yes, run the above command.


Can't load i915kms: Operation not permitted 


Friend Of Jolly Devil said:


> To check if you have both installed run
> `pkg info xf86-video-intel drm-kmod`
> 
> If it says 'no package matching' install it using ports. After installation run as root 'kldload i915kms' and check if you can startx.


xf86 - yes 
drm-kmod - no - how would be the eaisest way to do that?


monwarez said:


> You can use termbin to post your xorg log
> `cat /var/log/Xorg.0.log | nc termbin.com 9999`
> Also try to do `startx` with a non root account, some GUI application will not work if run by root.
> Do not forget to add the regular user to the video group
> ...


after mistyping twice


			https://termbin.com/5rem
		

-sh: v: not found


----------



## monwarez (Jan 24, 2022)

What is the output of: `ls /dev/dri`
And also `groups` (for the user running startx)


----------



## Friend Of Jolly Devil (Jan 24, 2022)

Otho said:


> I poked in to every nook and cranny of my BIOS and see no place to select graphics cards or chip sets.



You could post some pictures 



Otho said:


> Can't load i915kms: Operation not permitted



As I wrote above, you must log in as root to execute the command. For that you use 'su' command after you've logged in as your normal user and provide root password you've set up during installation.



Otho said:


> xf86 - yes
> drm-kmod - no - how would be the eaisest way to do that?



The easiest way to do that is to use pkg as root:

`# pkg install drm-kmod`

If you want to use ports, you just do the same things as for other ports you've installed, you just need to go to graphics/drm-kmod under your ports tree and install it from there.
My suggestion is to install it with pkg first, if you succeed in starting X you can install it from ports.



grahamperrin said:


> Friend Of Jolly Devil there's much more to my case, feel free to open a topic about your case then we can compare notes. Thanks.



I'm not sure if this is not solved already. I found similar problem on a mailing list from last year (April?), the difference is i915kms was missing after drm-kmod installation, and installing xf86-video-intel had solved it. In my case i915kms was missing after xf86... installation and I had to install drm-kmod. I must try again on fresh install first, and if it's still broken I'll open a topic. On this computer even if I remove drm-kmod everything's still working


----------



## SirDice (Jan 24, 2022)

Otho said:


> I poked in to every nook and cranny of my BIOS and see no place to select graphics cards or chip sets.


It's often abbreviated, PEG is PCI Express Graphics, in other words, a PCIe video card. IGD is Integrated Graphics Device, in other words, the iGPU that's built into the CPU.


----------



## Otho (Jan 24, 2022)

monwarez said:


> Do not forget to add the regular user to the video group


I just figured out how to do this, added both root and user still not working with either.


monwarez said:


> What is the output of: `ls /dev/dri`
> And also `groups` (for the user running startx)


no such file or directory
wheel operator video


Friend Of Jolly Devil said:


> You could post some pictures
> 
> 
> 
> ...


thought I had done it as root - can't load i915kls: No such file or directory
I'll try to figure out porting later tonight, I'm going to have to work it out sooner or later anyway.


SirDice said:


> It's often abbreviated, PEG is PCI Express Graphics, in other words, a PCIe video card. IGD is Integrated Graphics Device, in other words, the iGPU that's built into the CPU.


I looked again the closes references are to set video memory size, Virtualization Technology (VTx) and Virtualization Technology for Directed I/O (VTt)


----------



## SirDice (Jan 24, 2022)

Otho said:


> I looked again the closes references are to set video memory size, Virtualization Technology (VTx) and Virtualization Technology for Directed I/O (VTt)


Not all implementations have it, so it's not uncommon to not have that setting.


----------



## monwarez (Jan 24, 2022)

Otho said:


> I just figured out how to do this, added both root and user still not working with either.
> 
> no such file or directory
> wheel operator video
> ...


Not sure if this is a typo from writing back the error, but did you `kldload i915kms` (not kls).
While here: `ls /boot/modules/i915kms.ko`
If it does not exist, then make sure that graphics/drm-kmod is installed


----------



## Otho (Jan 24, 2022)

Friend Of Jolly Devil said:


> To check if you have both installed run
> `pkg info xf86-video-intel drm-kmod`
> 
> If it says 'no package matching' install it using ports. After installation run as root 'kldload i915kms' and check if you can startx.


drm-kmod was the missing piece of the puzzle. (which I think has been mentioned several times).
I broke down and looked into installing from ports, turns out it's extremely easy once you have a basic understanding.

Thank you all, this has been a great introduction into the world of FreeBSD, look for my next question, coming soon to a forum near you.


----------



## grahamperrin@ (Jan 25, 2022)

Afterthought:



Otho said:


> … added both root and user …



As far as I know, it's never necessary to add the `root` user to any user group.

pw(8)

I want to say, _root is the superuser_, but something about su(1) make me wonder whether it's technically correct to say so.


drm-kmod



Otho said:


> – was the missing piece of the puzzle. (which I think has been mentioned several times). …



Ignoring the top one-third of the page, does <https://wiki.freebsd.org/Graphics#drm-kmod> make sense to you, as a novice? 

I mean, would it have made sense _if_ you had stumbled into this part of the wiki before learning _anything_ about graphics on FreeBSD? 




Otho would you change the order of things in the pictured part of the page? 

(The fourth and fifth bullet points don't really fit under the phrase _Example configuration_, we can easily fix that.)


----------



## grahamperrin@ (Jan 25, 2022)

Friend Of Jolly Devil said:


> The situation with Intel drivers is a bit complicated. I had to install both of these. Yes, drm-kmod *should* suffice, but if not, install the other driver too.



I'd love the wiki page to be unmistakably clear with regard to rules (or rules of thumb with exceptions).

With the current wording, in the screenshot above I see "Blah, blah, most cases blah optional", which is not good enough (I'm being ruthless, cruel, about my _own_ edition of the page). IMHO this type of thing is *crying out for a flowchart*, a flowchart to cover more than just graphics, for newcomers. Here's not the place to discuss flowcharts (off-topic, solved etc.) … I'll probably go solo to produce something.


----------



## Friend Of Jolly Devil (Jan 25, 2022)

grahamperrin said:


> I'd love the wiki page to be unmistakably clear with regard to rules (or rules of thumb with exceptions).
> 
> With the current wording, in the screenshot above I see "Blah, blah, most cases blah optional", which is not good enough (I'm being ruthless, cruel, about my _own_ edition of the page). IMHO this type of thing is *crying out for a flowchart*, a flowchart to cover more than just graphics, for newcomers. Here's not the place to discuss flowcharts (off-topic, solved etc.) … I'll probably go solo to produce something.



As for Intel, there are 2 problems, not very clear wiki page (obsolete table, optional drivers without any condition statement, misleading info - in reality not all HD graphics are supported by drm-kmod, there's no info what to do with pre-HD cards, etc.), and probably a bug affecting i915kms installation also on amd64. It would be nice to have a dedicated thread for discussion


----------



## Otho (Jan 26, 2022)

grahamperrin said:


> Afterthought:
> 
> 
> 
> ...


Probably wouldn't have done me any good, now most of it makes sense and if the reader has some knowledge this would probably be helpful (I had zero and to be honest, I don't have much when it comes to Linux either).
As for SU I was under the impression it stands for Switch User.


----------



## grahamperrin@ (Jan 26, 2022)

Otho said:


> As for SU I was under the impression it stands for Switch User.



I never paid close attention to the name, but now I see, *substitute user identity*. 

For switching; default user is the superuser; and UID `0` is `root`.


----------



## Friend Of Jolly Devil (Jan 27, 2022)

I've tested drm-kmod and intel drivers on a fresh install of FreeBSD 13. For Intel HD and preHD cards  driver from xf86-video-intel doesn't work. Xorg loads VESA, forcing intel driver manually doesn't work (I mean, forcing does work, intel driver doesn't).
Drm-kmod works, but it's for HD 3000 and later cards, so hopefully it won't blow up my computers


----------



## drr (Feb 3, 2022)

Otho said:


> drm-kmod was the missing piece of the puzzle. (which I think has been mentioned several times).
> I broke down and looked into installing from ports, turns out it's extremely easy once you have a basic understanding.
> 
> Thank you all, this has been a great introduction into the world of FreeBSD, look for my next question, coming soon to a forum near you.



Otho, you may add the 'Solved' prefix to your thread Thread encouraging-use-of-the-solved-prefix.82253. Thanks.


----------

