Solved Installing X-Windows/Motif

Paolo_R

Member

Reaction score: 1
Messages: 48

I've just installed FreeBSD in VirtualBox on Windows, using the VM image on this website. I am familiar with the command line operation of UNIX systems but I would like to try a visual windowing approach, specifically Motif style.

I have never done this before and I would ask

(a) is setting up an X-Windows system possible when running FreeBSD in an emulator?
(b) if it is, can anyone provide me with a 'how to' idiot's guide to setting up such a system, possible someone who has done it themselves?

Thanks
Paul
 
Last edited:

kpedersen

Daemon

Reaction score: 509
Messages: 1,381

Once you have read through the documentation, you should have something similar to these very brief steps. Install Xorg, install Motif, set up the Motif Window Manager as user and finally start using it:

Code:
# pkg install xorg
# pkg install open-motif
$ echo "mwm" > ~/.xinitrc
$ startx
Mwm is a decent choice for VMs. I find some of the more modern window managers are becoming a little bit too dependent on a GPU to be useful.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Mmmm, I've hit an issue -trying to install the pkg management tool gives "pkg: mkstemp() :Read-only file system".
The FreeBSD I have is a virtual machine image from the FreeBSD web site. How do I correct thiss issue?

Paul
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

OK, I've fixed it -starting in Multi-user mode solvess the problem.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Problem: "First, install the emulators/virtualbox-ose-additions package " - OK did this and a lotof stuff was installed.

"# cd /usr/ports/emulators/virtualbox-ose-additions && make install clean"

No such file or directory ???

Paul
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Well I seem to have got over that problem. I can load mwm and show things like xclock and xcalc. When I quit there is a message "xauth: file /root/.Xauthority does not exist".

What does this indicate? And how do I correct it?

Thanks
Paul
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,399
Messages: 29,965

Don't start X as root, create a normal user account and use that. Use su(1) or sudo(8) if you need to do something that requires root access.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

SirDice

Thanks. I've done that but I still get a lot of errors when I exit X WIndows, such as :

"xterm: Fatal IO error 35 ..." and I still get the "xauth: file /home/paul/.Xauthority does not exist". See attached screen shot.
 

Attachments

kpedersen

Daemon

Reaction score: 509
Messages: 1,381

It looks like you have not yet added your hostname into /etc/hosts.

Code:
127.0.0.1          hostname    hostname.my.domain
replace hostname and my.domain with what you have set during install. Or when you run the hostname command.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

It looks like you have not yet added your hostname into /etc/hosts.

Code:
127.0.0.1          hostname    hostname.my.domain
replace hostname and my.domain with what you have set during install. Or when you run the hostname command.
As I'm running FreeBSD in VirtualBox are there any specific domains or hostnames I should use or doesn't it really matter? I used a pre-configured virtual machine image from the FreeBSD website so I didn't set these up during install.

Paul
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,399
Messages: 29,965

Doesn't really matter for something locally. Try to think of something with a "hostname.domain.tld" structure. The domain.tld part can be something non-existing too. As long as the hostname.domain.tld in /etc/rc.conf and /etc/hosts matches up it's good.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Doesn't really matter for something locally. Try to think of something with a "hostname.domain.tld" structure. The domain.tld part can be something non-existing too. As long as the hostname.domain.tld in /etc/rc.conf and /etc/hosts matches up it's good.
Well, I added "paul.dell.pc" to rc.conf as hostname and ::1 localhost paul.dell.pc and 127.0.0.1 local host paul.dell.pc to hosts and I still got the errors shown in my screen shot.

Where is .Xauthority supposed to be?

Paul
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Sorry, I forgot to reboot after making these changes. No more errors after reboot.

A couple more questions:
(a) I am using the VirtualBox guest additions and the -ose-additions. I have vboxguest and vbox service enabled in rc.conf. Is this correct?
(b) I use a USB mouse. In rc.conf I have moused_port="/dev/psm0", moused_type="auto" and moused_enable="YES". Are these correct?
(c) During the boot process I notice something which says "vt (vga) 80x25" (I think) which presumable sets the screen size/resolution. How do I change this, if it is possible, to somethng like1026x768 resolution?

Thanks
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,399
Messages: 29,965

a) Yes
b) It's not relevant what type of mouse you have attached to the host, the VM only gets to "see" an emulated one. I've found setting the VM's mouse properties to 'PS/2' to work best for a FreeBSD VM.
c) See vt(4)
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

a) Yes
b) It's not relevant what type of mouse you have attached to the host, the VM only gets to "see" an emulated one. I've found setting the VM's mouse properties to 'PS/2' to work best for a FreeBSD VM.
c) See vt(4)
Thanks for the replies. I already have 'PS/2' properties for the mouse so it's good to have confirmation.

I've looked at vt - as I understand it I need to add kern.vt.fb.default_mode="1024x768" to /boot/defaults/loader.conf (There isn't a /boot/loader.conf.) Having examined loader.conf a couple of times I can't see any reference to the 'vt (vga) 80x25' which appears when booting, so maybe that's a default. The only place where kern.* type entries appear is in 'Kernel tunables' so, presumably, I'd add kern.vt.fb.default_mode="1024x768" to this section. Would this be correct?

Sorry about so many questions. I have actually managed to get an X-Windows set up working so, for me, it's all about tuning text-mode UNIX and X-Windows before I embark on the adventure of tryig to install CDE :)

Paul
 

kpedersen

Daemon

Reaction score: 509
Messages: 1,381

If you plan to use CDE, perhaps you don't need to spend so much time tweaking the terminal. After all, CDE will provide dtlogin which will start X11 at boot up and allow you to log into your desktop. You will never need to use the text console directly and will barely see it when your computer starts.

Likewise, I think X11 actually handles the mouse in its own way rather than moused (which is just for the terminal).
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

If you plan to use CDE, perhaps you don't need to spend so much time tweaking the terminal. After all, CDE will provide dtlogin which will start X11 at boot up and allow you to log into your desktop. You will never need to use the text console directly and will barely see it when your computer starts.

Likewise, I think X11 actually handles the mouse in its own way rather than moused (which is just for the terminal).
Thanks - I recognise what you say. I just envisage that occasionally I might need or want to drop down to text-mode UNIX hence the tweaking.

Paul
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,399
Messages: 29,965

Never edit /boot/defaults/loader.conf, put your changes in /boot/loader.conf (create the file if it doesn't exist). The defaults file will get mangled with your next update, removing all your modifications.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Never edit /boot/defaults/loader.conf, put your changes in /boot/loader.conf (create the file if it doesn't exist). The defaults file will get mangled with your next update, removing all your modifications.
So should I copy /boot/defaults/loader.conf to /boot/loader.conf and add kern.vt.fb.default_mode="1024x768" to the Kernel tunable section of the (new) /boot/loader.conf?

Thanks
Paul
 

tingo

Daemon

Reaction score: 384
Messages: 2,001

No. /boot/defaults/loader.conf is fine. You do not need to copy anything from it. Simply create /boot/loader.conf and add
Code:
kern.vt.fb.default_mode="1024x768"
to it.
 
OP
OP
P

Paolo_R

Member

Reaction score: 1
Messages: 48

Tingo
That has had no effect, I'm afraid. I'm wondering - I have a NVIDIA GeForce GT540M display adapter. Do I need to load the 'nvidia' driver to be able to achieve different screen resolutions? Or will this not affect text-mode UNIX?

Paul
 
Top