manjaro中virtualbox(vbox)配置

一、更新源的配置:

1)、自动方法:

在 终端 执行下面的arch" style="color: #002be5">命令从官方的源列表中对中国源进行测速和设置

sudo pacman-mirrors -c China

2)、手动方法
自动方法(上面的方法1,自动测速)的源ping虽然低但是更新时不是很稳定,下载速度忽高忽低,所以也可以用下面的方法手动指定想要使用的源。

创建一个名为 /etc/pacman.d/mirrors/Custom的文件,并在里面加入:

 

复制代码
##
## Pacman Mirrorlist
##
[Custom]
Server = http://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch # 目前中国有四个源我去除了两个实际速度不加的,查看官方的源列表 http://repo.manjaro.org/ # 可以加入其它的软件源,格式与这个类似。
复制代码

保存后接着编辑 /etc/pacman-mirrors.conf,使 pacman-mirrors 只对这个文件列出的镜像站进行排行:

复制代码
OnlyCountry = Custom
复制代码

如果需要关闭测速则进一步修改

复制代码
Method=random
复制代码

保存后终端执行

复制代码
sudo pacman-mirrors -g
复制代码

linux-cn源" class=" sm_bf" style="color:#000000;font-weight:700;margin:5px 0px;">二、额外增加Arch Linux CN源

Manjaro是基于Arch的,而AUR是Arch社区用户维护的软件包(也是arch可用软件量巨大的所在),我们等下要安装的搜狗拼音、chrome等不少软件都在这里维护。不过网慢啊~!所以我们可以为Manjaro增加这个中文社区的源来方便我们安装一下软件。

/etc/pacman.conf文件末尾添加行:

复制代码
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
复制代码

然后安装 archlinuxcn-keyring 包以导入 GPG key,否则的话key验证失败会无法安装的。

 

 

 

下面是网上抄来的添加中科大源的方法:

#先排列源
sudo pacman-mirrors -g

#同步并优化(类似磁盘整理,固态硬盘无需操作)
sudo pacman-optimize&& sync

#升级系统 (根据自己需要决定运行否)
sudo pacman -Syyu

添加中科大源

#打开配置文件
sudo nano /etc/pacman.conf
在文件末尾添加

复制代码
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
复制代码

#导入GPG Key

复制代码
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring
复制代码

现在可以安装软件了,比如 chrome 和搜狗拼音输入法

#安装chrome
sudo pacman -S google-chrome

添加了中科大源后,也可以直接在添加/删除软件里搜索直接安装

安装搜狗拼音输入法

复制代码
sudo pacman -S fcitx-im #默认全部安装sudo pacman -S fcitx-configtoolsudo pacman -S fcitx-sogoupinyin
复制代码

#添加输入法配置文件
sudo pacman nano ~/.xprofile
添加以下内容

复制代码
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
复制代码

 

 

 

archlinux 的自启动

1,一般情况下新建一个 ~/.xprofile文件然后在里面加入命令就可以了。注意该文件是由 GDM/KDM/startx 等呼叫起来的,里面的命令执行完毕之后控制权会交回给 GDM/KDM/startx。

2,.xinitrc/.xsession 就比较特殊了,虽然也可以在里面放置需要启动时执行的命令,且也是由 由 GDM/KDM/startx 等呼叫起来的,但是这些命令执行之后控制权无法回到 GDM/KDM/startx。因此你需要在这些文件的末尾放置: exec $(get_session)  或  exec gnome-sessionexec startkdeexec enlightenmentexec icewm之类的。

 

3,所有linux发行版的自启动文件测试

把这三个文件 (如果有的话) 先备份起来, 然后建立一个测试用的 .xprofile, 里面放一句:

    (echo -n "$0 is called at " ; date) >> ~/startup.log

这句话是打印出自己的名字(即$0)及被执行的时间,并写入到log文件里。注意有些系统需要文件的可执行属性,记得修改下,即 chmod u+x .profile。 然后重启或注销再登录,检查 ~/startup.log的内容。然后把 .xprofile 改名为 .xinitrc,记得在最后加上一句 exec $(get_session) ,再次重启、再登录,检查 startup.log。最后把 .xinitrc 改成 .xsession, 重启、登录,检查 startup.log。  警告,.xinitrc 及 .xsession 必须加上 exec $(get_session),如果忘记加或者加错了,则无法进入桌面视窗,会立即退回到登录界面。 这是需要按 ctrl-alt-f6 切换到文字模式,然后删除 .xinitrc / .xsession 或者把他们的最后那句写对,就可以继续登录桌面视窗了。 这中方法可以对所有linux发行版的自启动文件进行测试,看哪个文件可以加入自启动命令。

 

manjaro 安装 virtualbox 的方法:

1, 因为 virtualbox 有模块要安装到内核里面,你需要知道你当前的内核版本:

uname -r,比如输出了v4.14.20-2-MANJAROv那么你的内核版本为414。

2, 然后运行:

复制代码
sudo pacman -S virtualbox
复制代码

安装完成后重启 virtualbox 或者 直接重启机器,以下命令是重启 virtualbox:

复制代码
sudo vboxreload
复制代码

 

3, 安装扩展包,以下命令可以查看或者安装扩展包的名字:

复制代码
sudo pacman -Ss virtualbox-ext-oracle
复制代码

如果以上命令没有安装,你可以去官网下载对应的扩展包。然后安装如下过程安装:

3.1, 以sudo 方式运行 virtualbox, 从菜单选择 File -> Preference, 选择 Extension tab, 然后 点击 Add Package, 安装刚才下载的扩展包。

4, 将当前登录用户加入 vboxusers 组:

复制代码
sudo gpasswd -a $USER vboxusers
复制代码

5, 如果你使用了多个内核, (使用单内核的请忽略这一步):

5.1, 如果安装virtualbox时是单内核,即多内核是在安装 virtualbox 之后才加入的,那么没必要再重新安装 vritualbox 及其扩展包了,因为 manjaro 会自动探测到已安装的模块,然后在新的内核中自动添加。

5.2, 如果你安装 virtualbox 之前就已经是多内核了,则:

5.2.1. Select the appropriate kernel at the bootup screen

5.2.2. Download the VirtualBox Host Utilitiesfor that particular kernel, as this provides the necessary vboxdrvVirtualBox module to add. The syntax of the command to do so is:

sudo pacman -S [kernel version]-virtualbox-host-modules

When listing the kernel version currently being used in the command, it is not necessary to write the entire version number. Any version of Kernel 3.5 can be listed simply as 'linux35', and any version of Kernel 3.6 can be listed as 'linux36', and so on. As an example, the following command will install the VirtualBox Host Utilitiesspecifically for kernel version 3.5:

sudo pacman -S linux35-virtualbox-host-modules

5.2.3. Once the VirtualBox Host Utilitieshave been downloaded, enter the following command to add the VirtualBox module to the kernel:

sudo modprobe vboxdrv

 

 

VirtualBox 安装 ArchLinux 的 guest 增强功能的方法:

网上说 manjaro 会自动安装上 virtualbox 的 guest 增强功能,请自行检查,如果没有安装上,请以如下方式安装:

当用VirtualBox安装ArchLinux时(即ArchLinux作为guest),启用增强功能的方式与其他Linux有所区别,在ArchLinux需要不必采用附加镜像安装增强功能的方式,而是直接安装官方仓库中的virtualbox-guest-modules包即可,如过需要增强功能随着内核升级而动态更新则需要安装dkms服务,执行以下命令完成增强功能的安装:

# pacman -S virtualbox-guest-modules virtualbox-guest-dkms

当增强功能安装完成后,需要启动对应的内核模块:

# modprobe -a vboxguest vboxsf vboxvideo

之后还需要运行VirtualBox客户端脚本确保相关特性全部开启:

# VBoxClient-all

如果经常使用增强功能,则可以开启服务:

# systemctl enable vboxservice

然后就可以尝试挂载你的分区了:

# mount -t vboxsf [你的共享文件夹的名字] [需要挂载到的位置]

 

 

archlinux 启动 sshd

首先检查是否安装了它,直接在命令行敲 sshd 看看有没有这个命令,没有则安装它:

复制代码
sudo pacman -S openssh
复制代码

然后运行:

复制代码
ystemctl start sshd.service
复制代码

则可以将sshd运行起来。

 

manjaro 禁止开机启动 bluetooth:

systemctl list-unit-files --type=service | grep enabled           # lists of enabled services
sudo systemctl stop bluetooth.service                 # stops the service
sudo systemctl disable bluetooth.service                 # disables service from loading at boot
systemctl status bluetooth.service                   # verify that service got disabled
arch" style="color: #002be5">sudo systemctl mask bluetooth.service                 # if you really want it dead (so other services can’t start it again)
systemctl list-unit-files --type=service                 # lists of ALL services (some STATIC are dependancies of other services and can’t be disabled)

备注:有些进程/服务,如果你不将它们进行mask,即使被disable了,也有可能被其它进程再次启动起来。

 

manjaro 设置 fcitx 输入法:

1、设置它只有在使用额外切换键隐藏输入法后,才可以再使用额外切换键将其唤醒:

直接运行 fcitx-configtool 即可进行图形界面配置。

然后查看 .config/fcitx/config 里的相应值是否已经改变,然后立即手动将  .config/fcitx/config 和  .config/fcitx/profile 的所有写属性去掉,即 chmod a-w  .config/fcitx/config;  chmod a-w  .config/fcitx/profile;

原文地址:https://www.cnblogs.com/littlesuns/p/9865605.html