Posts

Showing posts with the label FreeBSD

Install clickhouse on FreeBSD 14.1

Image
Install command: # pkg install clickhouse Start clickhouse server $ clickhouse server Start clickhouse server without any ouput $ clickhouse server > /dev/null 2>&1 & Start clickhouse client $ clickhouse client

Set static IP and DNS for FreeBSD

1. Set IP address and default router # ee /etc/rc.conf Add content as following into rc.conf. ifconfig_em0="inet 192.168.1.18 netmask 255.255.255.0" defaultrouter="192.168.1.1" save it, push keyboard buttons ESC ,  A ,  A . 2. Setting up DNS # ee /etc/resolv.conf Content of resolv.conf nameserver 8.8.8.8 nameserver 1.1.1.1 save it, push keyboard buttons  ESC ,  A ,  A . 3. Restart network # sh /etc/rc # /etc/netstart

Failed to execute login command on FreeBSD

Image
After I deleted slim package with command "pkg delete". And I installed slim back. But when I login to my FreeBSD and the error message comes out as following: I am sure I enter the right username and password. And I use the root to login, I got the same result. Solution: Press Keyboard "Ctrl" , "Alt" and "F1" or "F2"  and it will go to the terminal as following: I can login now.

Fullscreen for FreeBSD VMWare

There is the solution: # pkg install open-vm-tools # pkg install xf86-video-vmware

FreeBSD安装fcitx中文输入法(csh/tcsh)

Install # pkg install zh-fcitx  # pkg install zh-fcitx-libpinyin # pkg install zh-fcitx-table-extra # pkg install zh-CJKUnifonts Configurations 1. 文件 ~/.cshrc 添加的內容如下: setenv XMODIFIERS @im=fcitx 2.文件 ~/.xinitrc 內容如下: exec fcitx -d & . /usr/local/etc/xdg/xfce4/xinitrc

FreeBSD安装SCIM中文输入法(csh/tcsh)

1. 安装拼音 # pkg install zh-scim-pinyin 2. 安装五笔 # pkg install zh-scim-tables Install CJKUnifonts # pkg install zh-CJKUnifonts 3. 配置 ~/.cshrc % ee ~/.cshrc 加入下面两行: setenv XMODIFIERS @im=SCIM setenv LC_CTYPE zh_CN.UTF-8 4. 配置 ~/.xinitrc   % ee ~/.xinitrc 在确保执行xfce命令之前, 如下: exec scim -d & . /usr/local/etc/xdg/xfce4/xinitrc 5. 重启 # reboot

How to mount ntfs disk on FreeBSD

1.  Install fusefs-ntfs # pkg install fusefs-ntfs Add the following content to file /boot/loader.conf   fusefs_load="YES" 2. And then reboot. # reboot 3. Mount ntfs disk # ntfs-3g  /dev/da0s1 /media /dev/da0s1 : The ntfs disk. /media : Where your ntfs disk disk will be mounted. 

How to install Linux(Ubuntu Server 20.04) VM on FreeBSD 13.0 using bhyve and ZFS

Image
1. Preparing the Host First, load the bhyve kernel module: # kldload vmm Then, create a tap interface for the network device in the virtual machine to attach to. In order to for the network device to participate in the network, also create a bridge interface containing the tap interface and the physical interface as members. In this example, the physical interface is em0: # ifconfig tap0 create # sysctl net.link.tap.up_on_open=1 net.link.tap.up_on_open: 0 -> 1 # ifconfig bridge0 create # ifconfig bridge0 addm em0 addm tap0 # ifconfig bridge0 up 2. Preparing for the Installation Download  Ubuntu Server 20.04.3 LTS In order to boot Linux systems, grub2-bhyve must be first installed as follows: # pkg install grub2-bhyve     3. Creating a Linux Guest A ZFS volume can be created by: # zfs create -V16G -o volmode=dev zroot/linuxdisk0 Create a device.map that grub will use to map the virtual device to the files on the host system: (hd0)  /dev/zvol/zroot/linuxdisk0 (...

How to install Windows10 VM on FreeBSD 13.0 using bhyve and ZFS.

1. Preparing the Host First, load the bhyve kernel module: # kldload vmm   Then, create a tap interface for the network device in the virtual machine to attach to. In order to for the network device to participate in the network, also create a bridge interface containing the tap interface and the physical interface as members. In this example, the physical interface is em0: # ifconfig tap0 create # sysctl net.link.tap.up_on_open=1 net.link.tap.up_on_open: 0 -> 1 # ifconfig bridge0 create # ifconfig bridge0 addm em0 addm tap0 # ifconfig bridge0 up 2. Using ZFS with bhyve Guests A ZFS volume can be created by: # zfs create -V88G -o volmode=dev zroot/win10disk0   If you want to destroy ZFS file. # zfs list   For example the ZFS file you want to destroy is  win10disk0: # zfs destroy  zroot/win10disk0 3. Preparing for the Installation Download an installation image of  Windows10 to install: https://www.microsoft.com/en-us/software-download/windows10ISO Instal...

How to install FreeBSD VM on FreeBSD using bhyve and ZFS.

1. Preparing the Host  First, load the bhyve kernel module: # kldload vmm Then, create a tap interface for the network device in the virtual machine  to attach to. In order for the network device to participate in the network,  also create a bridge interface containing the tap interface and the physical  interface as members. In this example, the physical interface is em0: # ifconfig tap0 create # sysctl net.link.tap.up_on_open=1  net.link.tap.up_on_open: 0 -> 1 # ifconfig bridge0 create # ifconfig bridge0 addm em0 addm tap0 # ifconfig bridge0 up 2. Using ZFS with bhyve Guests If ZFS is available on the host machine, using ZFS volumes instead of disk  image file can provide significant performance benefits for the guest VMs.  A ZFS volume can be created by: # zfs create -V16G -o volmode=dev zroot/freebsddisk0 Download an installation image of FreeBSD to install:  https://download.freebsd.org/ftp/releases/ISO-IMAGES/13.0/ or ...

FreeBSD安装xfce图形桌面

 1. 安装依赖及xfce # pkg install -y xorg # pw groupmod video -m username # pkg install -y xfce # pkg install -y slim # pkg install -y slim-themes 2. 使能xfce # ee /etc/rc.conf 添加内容如下: moused_enable="YES" dbus_enable="YES" slim_enable="YES" 为了通过输入startx从命令行启动xfce, 需要往~/.xinitrc加入下面的命令: % echo ".   /usr/local/etc/xdg/xfce4/xinitrc" > ~/.xinitrc 3. 往slim.conf添加默认用户名 往slim.conf添加默认用户名好处是每当你要登录时就省去了输入用户名的时间. # ee /usr/local/etc/slim.conf 把下面这行的注释去掉并把username改为你的用户名 default_user  username 4. 重启 # reboot 5. 其他问题查 handbook https://docs.freebsd.org/en/books/handbook/x11/

FreeBSD卸载用不到的依赖库或软件.

 FreeBSD卸载软件一般的命令是: # pkg delete software_name 或 # pkg delete -R software_name 后来发现上面的两个命令不能把安装软件A时连带一起安装的依赖库或者软件也给安装; 但是这些依赖库或者软件,在软件A卸载时,并没有一起被卸载掉. 那么怎么才能把这些没有用到的依赖库或者软件给卸载掉呢? 命令如下: # pkg autoremove