wrest ([info]wrest) wrote,
@ 2009-03-02 12:28:00
Previous Entry  Add to memories!  Share this!  Next Entry
Current mood: annoyed
Entry tags:linux

linux -- тварь ли я дрожащая или право имею?
Наверное будет несколько постов про linux, так что поставил даже таг.

Установил altlinux в виртуальную машину (virtualbox от sun).

Далее, чтобы разрешение жкрана было не 800х600, надо установить драйвер дисплея, ну и чтобы мышка адекватно себя вела -- драйвер мышки.

Все это есть в файле vboxlinuxadditions-x86.run который на образе CD
Подключаю образ CD.
Кликом на файле vboxlinuxadditions-x86.run почему-то открывается текстовый редактор KWrite, хотя в свойтсвах файла написано "Скрипт shell".

Ладно. В Интернете нашел что надо сделать команду sudo и имя файла *.run
Открываю командную строку, перехожу в директорию, запускаю sudo -- оно говорит мне что юзера нет в файле судоеров. Какого хрена? Безопасность... Ладно, захожу в управление юзерами, добавляю юзера в группу админов. Толку нет, нет в списке судоеров, инцидент will be reported.

Ладно. Открываю командную строку от пользователя root, все то же самое, запускаю sudo и имя файла.
Но и пользователя root нет в файле судоеров. Какого хрена? Как, спрашивается, установить эти чертовы additions? В шоке.

Image Hosted by ImageShack.us




(21 comments) - (Post a new comment)


[info]ivlad
2009-03-02 10:07 am UTC (link)
сделай

cat /etc/sudoers

и покажи

(Reply to this) (Thread)


[info]ivlad
2009-03-02 10:13 am UTC (link)
заодно открой командную строку от имени пользователя и сделай

id -a

и тоже самое от root

(Reply to this) (Parent)(Thread)


[info]wrest
2009-03-02 12:14 pm UTC (link)
так. права добавились.
теперь чего-то нехватает другого:

[root@altlinux cdrom]# sudo sh ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.1.4 Guest Additions for Linux installation...........................................................................................................................................................................................................
VirtualBox 2.1.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.25-std-def-alt8.M41.4
Please install the GNU compiler.
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.
[root@altlinux cdrom]#

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 12:26 pm UTC (link)
vi для новичка - это трындец. Я понимаю. Или пользуйся другим редактором, или (предпочтительней, если собрался пользоваться linux, там от vi все равно не деться никуда) прочитай что-то вроде http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html

Please install the GNU compiler.

Это говорит о том, что оно хочет чего-то там из исходников скомпилировать, а компилятора у тебя нет. Если у тебя все правильно в Alt настроено (я, правда, не видел его никогда) надо сказать от рута

apt-get update
apt-get install gcc


Оно должно поставить из интернета GNU Compiler Collection (gcc) и все для него необходимое.

После этого пробуй еще раз.

Я смотрю, второй (или уже не второй?) опыт у тебя тоже не слишком воодушевляющий. :)

(Reply to this) (Parent)(Thread)


[info]wrest
2009-03-02 12:31 pm UTC (link)
много букав, но помоему оно не установилось

[root@altlinux cdrom]# apt-get update
Reading Package Lists... Done
Building Dependency Tree... Done
[root@altlinux cdrom]# apt-get install gcc
Reading Package Lists... Done
Building Dependency Tree... Done
Selecting gcc4.1 for 'gcc'
The following extra packages will be installed:
binutils gcc4.1 glibc glibc-devel glibc-kernheaders kernel-headers-common
libbfd
The following NEW packages will be installed:
binutils gcc4.1 glibc glibc-devel glibc-kernheaders kernel-headers-common
libbfd
0 upgraded, 7 newly installed, 0 removed and 0 not upgraded.
Need to get 0B/9255kB of archives.
After unpacking 18.8MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk libbfd 1:2.17.50.0.6-alt4
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk binutils 1:2.17.50.0.6-alt4
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk glibc 6:2.5.1-alt4
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk glibc-kernheaders 2.6.24-alt4
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk kernel-headers-common 1.1.9-alt1
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk glibc-devel 6:2.5.1-alt4
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Err cdrom://ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18 ALTLinux/disk gcc4.1 4.1.2-alt2
Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/libbfd-2.17.50.0.6-alt4.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/binutils-2.17.50.0.6-alt4.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/glibc-2.5.1-alt4.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/glibc-kernheaders-2.6.24-alt4.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/kernel-headers-common-1.1.9-alt1.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/glibc-devel-2.5.1-alt4.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
Failed to fetch cdrom:[ALT Linux 4.1.1 Desktop (Thymus) build 2008-12-18]/ALTLinux/RPMS.disk/gcc4.1-4.1.2-alt2.i586.rpm Unable to unmount the CD-ROM in /media/cdrom/, it may still be in use.
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[root@altlinux cdrom]#

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 01:04 pm UTC (link)
Ага, оно настроено не так, как я думал предположить. Оно считает, что у тебя в /media/cdrom есть диск с дистрибутивом. Кто-то настроил это так при создании виртуального образа.

покажи

cat /etc/apt/sources.list

там должно быть несколько строк вида

rpm cdrom:

и, возможно, закомментированных вида

rpm http:

(Reply to this) (Parent)(Thread)


[info]wrest
2009-03-02 01:33 pm UTC (link)
наверное оно так считает потому что я ставил этот линукс с дистрибутива с сидирома :) это кубунта была в виде готового диска виртуальной машины, а альтлинукс я ставил сам.

щас попробую подсунуть дистрибутив в cdrom. как-то он сразу не подсовывается.
короче, теперь sudo говорит что нехватает заголовков

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 01:38 pm UTC (link)
Не sudo, наверное, а скрипт этот.

Покажи ошибку.

(Reply to this) (Parent)(Thread)


[info]wrest
2009-03-02 01:40 pm UTC (link)
[root@altlinux cdrom]# sudo sh ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.1.4 Guest Additions for Linux installation...........................................................................................................................................................................................................
VirtualBox 2.1.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.25-std-def-alt8.M41.4
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.
[root@altlinux cdrom]#

(Reply to this) (Parent)


[info]wrest
2009-03-02 12:34 pm UTC (link)
не, не второй. третий или четвертый.
я даж как-то книжку купил "Запускаем Линукс" О'Рейли-евскую и наполовину её прочитал...
не помогает.

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 01:08 pm UTC (link)
хорошая книжка, кстати.

(Reply to this) (Parent)


[info]wrest
2009-03-02 01:34 pm UTC (link)
gcc установилось (видимо), теперь что-то с заголовками:

[root@altlinux cdrom]# sudo sh ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.1.4 Guest Additions for Linux installation...........................................................................................................................................................................................................
VirtualBox 2.1.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.25-std-def-alt8.M41.4
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.
[root@altlinux cdrom]#

(Reply to this) (Parent)


[info]wrest
2009-03-02 11:42 am UTC (link)
[root@altlinux ~]# cat /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification
User_Alias WHEEL_USERS = %wheel
User_Alias XGRP_USERS = %xgrp

# Cmnd alias specification

# Defaults specification

# If env_reset is disabled, sudo will NOT reset the environment
# to only contain the fixed list of variables.
# See sudoers(5) for details.
#Defaults:WHEEL_USERS !env_reset

# Preserve DISPLAY and XAUTHORITY environment variables
# for "xgrp" group members.
Defaults:XGRP_USERS env_keep += "DISPLAY XAUTHORITY"

# User privilege specification
#root ALL=(ALL) ALL

[root@altlinux ~]# id -a
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),19(proc)
[root@altlinux ~]#
из-под пользователя:
[dima@altlinux ~]$ id -a
uid=500(dima) gid=500(dima) группы=500(dima),10(wheel),14(uucp),19(proc),22(cdrom),71(floppy),80(cdwriter),81(audio),83(radio),102(camera),422(xgrp),36(scanner)
[dima@altlinux ~]$

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 12:33 pm UTC (link)
Смотри, в Linux группа администраторов зовется иногда root, иногда wheel (это исторически сложилось, не спрашивай, почему). Как ты можешь видеть, dima у тебя входит в wheel.

uid=500(dima) gid=500(dima) группы=500(dima),10(wheel),14(uucp),19(proc),22(cdrom),71(floppy),80(cdwriter),81(audio),83(radio),102(camera),422(xgrp),36(scanner)

Судя по виду sudoers, в этом дистрибутиве предполагается, что wheel является группой администраторов, есть ее упоминания.

Что бы sudo работало от пользователя dima (и всех, кто в группе администратор), надо вписать

WHEEL_USERS ALL=ALL

в sudoers

выходить из vi с сохранением файла так

[Esc]:wq

когда нажмешь :, внизу появится как бы командная строка

выход без сохранения

[Esc]:q!

(Reply to this) (Parent)


[info]ivlad
2009-03-02 01:22 pm UTC (link)
кстати, если ты root, sudo можно не запускать.

(Reply to this) (Thread)


[info]wrest
2009-03-02 01:37 pm UTC (link)
я бы рад вообще ничего не запускать. у меня есть файл на сидюке, называется
VBoxLinuxAdditions-x86.run и я хочу его установить. :-) и всё (пока). но для этого, как оказывается нужно несколько раз пройти через зад.

(Reply to this) (Parent)(Thread)


[info]ivlad
2009-03-02 01:40 pm UTC (link)
но для этого, как оказывается нужно несколько раз пройти через зад.

мне всегда казалось, для vmware это было проще сделано, видимо в sun не осилили сделать простую процедуру установки. :( sorry about that.

(Reply to this) (Parent)(Thread)


[info]wrest
2009-03-02 02:17 pm UTC (link)
> мне всегда казалось, для vmware это было проще сделано, видимо в sun не осилили сделать простую процедуру установки. :( sorry about that.

так а sun-то тут причем? или драйверы в виде .run -файла это какое-то извращение? ну тогда мобыть...

понимаешь, что собсно задевает -- конкверор этот знает, зобака, что файл .run -- это скрипт, но запускать его не желает, открывая в текстовом редакторе KWrite.

альлинукс изначально настроен так что файл .run запустить невозможно -- нет прав. и кроме того, не хватает там каких-то в нем заголовков... ну почему
1. Не положить заголовки куда надо сразу
2. Не запускать файлы .run из файл менеджера

(Reply to this) (Parent)


[info]frbrgeorge
2009-03-04 09:08 pm UTC (link)
# sh vboxlinuxadditions-x86.run

(Reply to this) (Thread)


[info]wrest
2009-03-04 09:39 pm UTC (link)
спасибо, но уже пришлось разобраццо что su это суперюзер а do - глагол...
теперь хочу поскорее забыть...

(Reply to this) (Parent)(Thread)


[info]frbrgeorge
2009-03-04 10:26 pm UTC (link)
Забудьте, ибо вы не разобрались.

(Reply to this) (Parent)


(21 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Log in with OpenID
English • Español • Deutsch • Русский…